finalBearingBetweenTwoGeoPoints static method

num finalBearingBetweenTwoGeoPoints(
  1. LatLng l1,
  2. LatLng l2
)

Calculates the final bearing (azimuth) from point l1 to point l2.

The final bearing is the initial bearing when traveling in the reverse direction from point l2 to point l1.

l1 - The LatLng coordinates of the starting point.

l2 - The LatLng coordinates of the ending point.

Returns the final bearing in degrees, where 0 degrees indicates a northward direction and 90 degrees indicates an eastward direction.

Implementation

static num finalBearingBetweenTwoGeoPoints(LatLng l1, LatLng l2) {
  return (bearingBetweenTwoGeoPoints(l2, l1) + 180) % 360;
}