abstract struct Number
Overview
The top-level number type.
Included Modules
- Comparable(Number)
- Steppable
Direct Known Subclasses
Defined in:
lapis/math.crInstance Method Summary
-
#approach(target : Number, step : Number) : Float64
Smoothly approaches
targetbystepwithout overshooting. -
#degrees : Float64
Converts this number (interpreted as degrees) into radians.
-
#radians : Float64
Converts this number (interpreted as degrees) into radians.
-
#to_degrees : Float64
Converts this number (interpreted as radians) into degrees.
Instance methods inherited from class Object
try?(&)try? try?
Instance Method Detail
Smoothly approaches target by step without overshooting.
current = 5.0
current = current.approach(10.0, 2.0) # => 7.0
current = current.approach(10.0, 5.0) # => 10.0 (does not overshoot)
Converts this number (interpreted as degrees) into radians.
rotation = 90.degrees # => ~1.5707963