Module: Graticule::RadiansAndDegrees

Defined in:
lib/graticule/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_degreesObject

Convert from radians to degrees


10
11
12
# File 'lib/graticule/core_ext.rb', line 10

def to_degrees
  ( self * 360.0 ) / Math::PI / 2
end

#to_radiansObject

Convert from degrees to radians


5
6
7
# File 'lib/graticule/core_ext.rb', line 5

def to_radians
  ( self / 360.0 ) * Math::PI * 2
end