Sha256: 544a34e6ae51401a64835e5ef0bffa52bb1df472c34e5656266c1c98971c72a8

Contents?: true

Size: 332 Bytes

Versions: 9

Compression:

Stored size: 332 Bytes

Contents

# encoding: UTF-8
module Graticule
  module RadiansAndDegrees
    # Convert from degrees to radians
    def to_radians
      ( self / 360.0 ) * Math::PI * 2
    end

    # Convert from radians to degrees
    def to_degrees
      ( self * 360.0 ) / Math::PI / 2
    end
  end
end

Numeric.send :include, Graticule::RadiansAndDegrees

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graticule-2.7.2 lib/graticule/core_ext.rb
graticule-2.7.1 lib/graticule/core_ext.rb
graticule-2.7.0 lib/graticule/core_ext.rb
graticule-2.6.0 lib/graticule/core_ext.rb
graticule-2.5.0 lib/graticule/core_ext.rb
graticule-2.4.0 lib/graticule/core_ext.rb
graticule-2.3.0 lib/graticule/core_ext.rb
graticule-2.2.0 lib/graticule/core_ext.rb
graticule-2.1.0 lib/graticule/core_ext.rb