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/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
Returns a
Geode::Degrees
ofself
degrees. -
#gradians
Returns a
Geode::Gradians
ofself
gradians. -
#radians
Returns a
Geode::Radians
ofself
radians. -
#to_degrees
Returns a
Geode::Degrees
ofself
radians. -
#to_gradians
Returns a
Geode::Gradians
ofself
radians. -
#to_radians
Returns a
Geode::Radians
ofself
radians. -
#to_turns
Returns a
Geode::Turns
ofself
radians. -
#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
#
def gradians
#
def radians
#
def to_degrees
#
def to_gradians
#
Returns a Geode::Gradians
of self
radians.
(Math::PI / 4).to_gradians # => 100.0 grad
See: Geode::Gradians
def to_radians
#
def to_turns
#
def turns
#