struct

Geode::Angle

Inherits Comparable < Struct < Value < Object

The Angle struct represents a geometric angle. Basic arithmetic as well as trigonometric functions can be applied to it.

Constructors

new(measure : Number::Primitive, unit : Symbol = :radians)

Creates a new Angle.

Source

Instance methods

*(other : Number)

Multiplies an angle's measure by the given scalar.

Source
+(other : Angle)

Adds the measures of two angles.

Source
-(other : Angle)

Subtracts the measure of one angle from another angle.

Source
/(other : Number)

Divides an angle's measure by the given scalar.

Source
<=>(other : Angle)

Compares the measures of two angles.

Source
boundary?

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.

Source
cos

Returns the cosine function of the angle.

Source
cot

Returns the cotangent function (inverse tangent) of the angle.

Source
csc

Returns the cosecant function (inverse sine) of the angle.

Source
degrees

Returns the angle's measure in degrees.

Source
full?

Returns whether or not the given angle represents a full circle, i.e. whether the angle's measure is divisible by 2pi / 360 degrees.

Source
half?

Returns whether or not the given angle represents a semi-circle, i.e. whether the angle's measure is divisible by pi / 180 degrees.

Source
normalize

Returns a new Angle with the measure restricted to the interval [0, 2pi) / [0, 360).

Source
quadrant

Returns which quadrant the angle lies in. If the angle lies on a quadrant boundary, it returns nil.

Source
radians

Returns the angle's measure in radians.

Source
reference

Returns the reference angle, i.e. the smallest angle that the terminal side makes with the x-axis.

Source
sec

Returns the secant function (inverse cosine) of the angle.

Source
sin

Returns the sine function of the angle.

Source
tan

Returns the tangent function of the angle.

Source
to_point(distance : Number = 1, center : Point = Point.new)

Returns the Point that lies distance units away from the terminal side centered at center.

Source