struct

Geode::Gradians(T)

Inherits Geode::Angle < Comparable < Steppable < Struct < Value < Object

Unit type for an angle measured in gradians (gons).

The T type parameter is the type used to store the angle's value. It should be a numerical type, preferably Float32 or Float64.

Constructors

full

Amount of gradians to complete a full revolution (360 degrees).

Source
half

Amount of gradians to complete a half revolution (180 degrees).

Source
new(angle : Angle) : self

Creates an angle by converting an existing one to gradians.

Source
new(value : T)

Creates an angle from the specified value.

Source
quarter

Amount of gradians to complete a quarter of a revolution (90 degrees).

Source
third

Amount of gradians to complete a third of a revolution (120 degrees).

Source

Instance methods

to_degrees

Converts this angle to degrees.

Source
to_gradians

Converts this angle to gradians.

Simply returns self.

Source
to_radians

Converts this angle to radians.

Source
to_s(io : IO) : Nil

Produces a string containing the angle.

The string is formatted as:

# grad
Source
to_turns

Converts this angle to turns.

Source