Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/navigate/conversions.rb
Instance Method Summary collapse
-
#to_bearing ⇒ Object
radians to bearing.
-
#to_degrees ⇒ Object
radians to degree.
-
#to_radians ⇒ Object
degrees to radians.
Instance Method Details
#to_bearing ⇒ Object
radians to bearing
8 9 10 |
# File 'lib/navigate/conversions.rb', line 8 def to_bearing (self.to_degrees + 360.0) % 360.0 end |
#to_degrees ⇒ Object
radians to degree
13 14 15 |
# File 'lib/navigate/conversions.rb', line 13 def to_degrees self * 180 / Math::PI end |
#to_radians ⇒ Object
degrees to radians
3 4 5 |
# File 'lib/navigate/conversions.rb', line 3 def to_radians self * Math::PI / 180.0 end |