finalBearing method
This function returns final bearing arriving at destination point from startPoint; the final bearing will differ from the initial bearing by varying degrees according to distance and latitude
startPoint
Initial coordinates
endPoint
Final coordinates
Returns Bearing in degrees from North, 0° ... 360°
Implementation
double finalBearing(Coordinate startPoint, Coordinate endPoint) {
final bearingValue = bearing(endPoint, startPoint) + 180;
return bearingValue.wrap360();
}