struct Geode::Turns(T)
- Geode::Turns(T)
- Geode::Angle(T)
- Struct
- Value
- Object
Overview
Unit type for an angle measured in turns.
The T type parameter is the type used to store the angle's value.
It should be a numerical type, preferably Float32
or Float64
.
Defined in:
geode/angles/turns.crConstructors
-
.full : self
Amount of turns to complete a full revolution (360 degrees).
-
.half : self
Amount of turns to complete a half revolution (180 degrees).
-
.new(angle : Angle) : self
Creates an angle by converting an existing one to turns.
-
.new(value : T)
Creates an angle from the specified value.
-
.quarter : self
Amount of turns to complete a quarter of a revolution (90 degrees).
-
.third : self
Amount of turns to complete a third of a revolution (120 degrees).
Instance Method Summary
-
#to_degrees : Degrees
Converts this angle to degrees.
-
#to_gradians : Gradians
Converts this angle to gradians.
-
#to_radians : Radians
Converts this angle to radians.
-
#to_s(io : IO) : Nil
Produces a string containing the angle.
-
#to_turns : Turns
Converts this angle to turns.
Instance methods inherited from struct Geode::Angle(T)
%(amount : Number) : Angle%(other : self) : Number
%(other : Angle) : Number %, &*(amount : Number) : Angle &*, &+(other : self) : self &+, &-(other : self) : self &-, *(amount : Number) : Angle *, +(other : self) : self
+(other : Angle) : Angle +, -(other : self) : self
-(other : Angle) : Angle
- : self -, /(amount : Number) : Angle
/(other : self) : Number
/(other : Angle) : Number /, //(amount : Number) : Angle
//(other : self) : Number
//(other : Angle) : Number //, <=>(other : self)
<=>(other : Angle) <=>, abs : self abs, abs2 : self abs2, acute? acute?, ceil : self ceil, floor : self floor, fraction : self fraction, full? full?, lerp(other : self, t : Number) : self lerp, near_zero?(tolerance : self)
near_zero?(tolerance : Angle)
near_zero?(tolerance : Number) near_zero?, negative? negative?, normalize : self normalize, oblique? oblique?, obtuse? obtuse?, positive? positive?, reflex? reflex?, right? right?, round(mode : Number::RoundingMode = :ties_even) : self
round(digits : Number, base = 10, *, mode : Number::RoundingMode = :ties_even) : self round, sign sign, signed_normalize : self signed_normalize, straight? straight?, to_f : Float to_f, to_unsafe to_unsafe, value : T value, zero? zero?
Constructor methods inherited from struct Geode::Angle(T)
new(value : T)
new,
zero : self
zero
Constructor Detail
Creates an angle by converting an existing one to turns.
Instance Method Detail
Produces a string containing the angle.
The string is formatted as:
# turn