Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/angle_conversions.rb
Instance Method Summary collapse
-
#to_degrees ⇒ Object
presumes self is a number of radians.
-
#to_radians ⇒ Object
presumes self is a number of degrees.
Instance Method Details
#to_degrees ⇒ Object
presumes self is a number of radians
6 7 8 |
# File 'lib/angle_conversions.rb', line 6 def to_degrees # presumes self is a number of radians self / (Math::PI / 180) end |
#to_radians ⇒ Object
presumes self is a number of degrees
2 3 4 |
# File 'lib/angle_conversions.rb', line 2 def to_radians # presumes self is a number of degrees self * Math::PI / 180 end |