Class: Numeric

Inherits:
Object
  • Object
show all
Extended by:
Math
Defined in:
lib/numeric_math.rb

Overview

Extend Numeric class with Math module methods.

Instance Method Summary collapse

Instance Method Details

#to_degObject

Convert self to dec.



41
42
43
# File 'lib/numeric_math.rb', line 41

def to_deg
    self * 180.0 / Math::PI
end

#to_radObject

Convert self to rad.



36
37
38
# File 'lib/numeric_math.rb', line 36

def to_rad
    self / 180.0 * Math::PI
end