struct

Number

Inherits Steppable < Comparable < Value < Object

The top-level number type.

Instance methods

Scales a matrix by this amount.

5 * Matrix[[1, 2, 3], [4, 5, 6]] # => [[5, 10, 15], [20, 25, 30]]
Source

Scales a vector by this amount.

5 * Vector[2, 3, 4] # => (10, 15, 20)
Source
degrees

Returns a Geode::Degrees of self degrees.

45.degrees # => 45°

See: Geode::Degrees

Source
gradians

Returns a Geode::Gradians of self gradians.

100.gradians # => 100 grad

See: Geode::Gradians

Source
inv

Returns the inverse of this value.

2.inv    # => 0.5
0.25.inv # => 4.0
Source
radians

Returns a Geode::Radians of self radians.

Math::PI.radians # => 3.14 rad

See: Geode::Radians

Source
to_degrees

Returns a Geode::Degrees of self radians.

(Math::PI / 4).to_degrees # => 45°

See: Geode::Degrees

Source
to_gradians

Returns a Geode::Gradians of self radians.

(Math::PI / 4).to_gradians # => 100.0 grad

See: Geode::Gradians

Source
to_radians

Returns a Geode::Radians of self radians.

Math::PI.to_radians # => 3.14 rad

See: Geode::Radians

Source
to_turns

Returns a Geode::Turns of self radians.

(Math::PI / 4).to_turns # => 0.25 turns

See: Geode::Turns

Source
turns

Returns a Geode::Turns of self turns.

0.25.turns # => 0.25 turns

See: Geode::Turns

Source