abstract struct Number
- Number
- Value
- Object
Overview
The top-level number type.
Included Modules
- Comparable(Number)
- Steppable
Defined in:
geode/extensions/angles.crgeode/extensions/matrices.cr
geode/extensions/number.cr
geode/extensions/vectors.cr
Instance Method Summary
-
#*(matrix : Geode::CommonMatrix) : Geode::CommonMatrix
Scales a matrix by this amount.
-
#*(vector : Geode::CommonVector) : Geode::CommonVector
Scales a vector by this amount.
-
#degrees : Geode::Degrees
Returns a
Geode::Degrees
ofself
degrees. -
#gradians : Geode::Gradians
Returns a
Geode::Gradians
ofself
gradians. -
#inv
Returns the inverse of this value.
-
#radians : Geode::Radians
Returns a
Geode::Radians
ofself
radians. -
#to_degrees : Geode::Degrees
Returns a
Geode::Degrees
ofself
radians. -
#to_gradians : Geode::Gradians
Returns a
Geode::Gradians
ofself
radians. -
#to_radians : Geode::Radians
Returns a
Geode::Radians
ofself
radians. -
#to_turns : Geode::Turns
Returns a
Geode::Turns
ofself
radians. -
#turns : Geode::Turns
Returns a
Geode::Turns
ofself
turns.
Instance Method Detail
Scales a matrix by this amount.
5 * Matrix[[1, 2, 3], [4, 5, 6]] # => [[5, 10, 15], [20, 25, 30]]
Scales a vector by this amount.
5 * Vector[2, 3, 4] # => (10, 15, 20)
def degrees : Geode::Degrees
#
def gradians : Geode::Gradians
#
def radians : Geode::Radians
#
def to_degrees : Geode::Degrees
#
def to_gradians : Geode::Gradians
#
Returns a Geode::Gradians
of self
radians.
(Math::PI / 4).to_gradians # => 100.0 grad
See: Geode::Gradians
def to_radians : Geode::Radians
#
def to_turns : Geode::Turns
#
def turns : Geode::Turns
#