Sha256: a4254cba059881f066dbde5714e1e15346d0014d3a4cd84d2aeab57d2e640a13

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

module Graticule
  module Distance
    
    EARTH_RADIUS = { :kilometers => 6378.135, :miles => 3963.1676 }
    # WGS-84 numbers
    EARTH_MAJOR_AXIS_RADIUS = { :kilometers => 6378.137, :miles => 3963.19059 }
    EARTH_MINOR_AXIS_RADIUS = { :kilometers => 6356.7523142, :miles => 3949.90276 }

    class DistanceFormula
      include Math
      extend Math
       
      def initialize
        raise NotImplementedError
      end
      
      # Convert from degrees to radians
      def self.deg2rad(deg)
        (deg * PI / 180)
      end

      # Convert from radians to degrees
      def self.rad2deg(rad)
        (rad * 180 / PI)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
GUI-graticule-0.2.7.2 lib/graticule/distance.rb
GUI-graticule-0.2.7.3 lib/graticule/distance.rb
GUI-graticule-0.2.7.4 lib/graticule/distance.rb
GUI-graticule-0.2.7.5 lib/graticule/distance.rb
GUI-graticule-0.2.7.6 lib/graticule/distance.rb