struct Geode::Angle
- Geode::Angle
- Struct
- Value
- Object
Overview
The Angle
struct represents a geometric angle.
Basic arithmetic as well as trigonometric functions can be applied to it.
Included Modules
- Comparable(Geode::Angle)
Defined in:
geode/angle.crConstructors
-
.new(measure : Number::Primitive, unit : Symbol = :radians)
Creates a new
Angle
.
Instance Method Summary
-
#*(other : Number)
Multiplies an angle's measure by the given scalar.
-
#+(other : Angle)
Adds the measures of two angles.
-
#-(other : Angle)
Subtracts the measure of one angle from another angle.
-
#/(other : Number)
Divides an angle's measure by the given scalar.
-
#<=>(other : Angle)
Compares the measures of two angles.
-
#boundary?
Returns whether or not the given angle lines on a quadrant boundary, i.e.
-
#cos
Returns the cosine function of the angle.
-
#cot
Returns the cotangent function (inverse tangent) of the angle.
-
#csc
Returns the cosecant function (inverse sine) of the angle.
-
#degrees
Returns the angle's measure in degrees.
-
#full?
Returns whether or not the given angle represents a full circle, i.e.
-
#half?
Returns whether or not the given angle represents a semi-circle, i.e.
-
#normalize
Returns a new
Angle
with the measure restricted to the interval [0, 2pi) / [0, 360). -
#quadrant
Returns which quadrant the angle lies in.
-
#radians : Float32 | Float64 | Int128 | Int16 | Int32 | Int64 | Int8 | UInt128 | UInt16 | UInt32 | UInt64 | UInt8
Returns the angle's measure in radians.
-
#reference
Returns the reference angle, i.e.
-
#sec
Returns the secant function (inverse cosine) of the angle.
-
#sin
Returns the sine function of the angle.
-
#tan
Returns the tangent function of the angle.
-
#to_point(distance : Number = 1, center : Point = Point.new)
Returns the
Point
that liesdistance
units away from the terminal side centered atcenter
.
Constructor Detail
Instance Method Detail
Returns whether or not the given angle lines on a quadrant boundary, i.e. whether the angle's measure is divisible by 1/2pi / 90 degrees.
Returns whether or not the given angle represents a full circle, i.e. whether the angle's measure is divisible by 2pi / 360 degrees.
Returns whether or not the given angle represents a semi-circle, i.e. whether the angle's measure is divisible by pi / 180 degrees.
Returns a new Angle
with the measure restricted to the interval [0, 2pi) / [0, 360).
Returns which quadrant the angle lies in. If the angle lies on a quadrant boundary, it returns nil.
Returns the angle's measure in radians.
Returns the reference angle, i.e. the smallest angle that the terminal side makes with the x-axis.
Returns the Point
that lies distance
units away from the terminal side centered at center
.