Module: Vincenty

Extended by:
Vincenty
Included in:
Vincenty
Defined in:
lib/latitude/vincenty.rb

Overview

Constant Summary collapse

WGS84_A =

in meters

6378137
WGS84_B =
6356752.314245
WGS84_F =
1 / 298.257223563

Instance Method Summary collapse

Instance Method Details

#final_bearing(start_lat, start_long, end_lat, end_long) ⇒ Object



23
24
25
26
27
# File 'lib/latitude/vincenty.rb', line 23

def final_bearing(start_lat, start_long, end_lat, end_long)
  return nil if (start_lat == end_lat) && (start_long == end_long)

  solution_set(start_lat, start_long, end_lat, end_long)[:final_bearing]
end

#great_circle_distance(start_lat, start_long, end_lat, end_long) ⇒ Object



11
12
13
14
15
# File 'lib/latitude/vincenty.rb', line 11

def great_circle_distance(start_lat, start_long, end_lat, end_long)
  return 0 if (start_lat == end_lat) && (start_long == end_long)

  solution_set(start_lat, start_long, end_lat, end_long)[:distance]
end

#initial_bearing(start_lat, start_long, end_lat, end_long) ⇒ Object



17
18
19
20
21
# File 'lib/latitude/vincenty.rb', line 17

def initial_bearing(start_lat, start_long, end_lat, end_long)
  return nil if (start_lat == end_lat) && (start_long == end_long)

  solution_set(start_lat, start_long, end_lat, end_long)[:initial_bearing]
end