bearing

number bearing(lat1, lon1, lat2, lon2)

Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between the initial and destination coordinates. The shortest path is defined using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless results.

Parameters

  1. lat1 — latitude of initial location.
  2. lon1 — longitude of initial location.
  3. lat2 — latitude of destination location.
  4. lon2 — longitude of destination location.

Returns