getRhumbLineBearing method
Returns the rhumb line bearing from the current location to the GeoLocation passed in.
@param location destination location @return the bearing in degrees
Implementation
double getRhumbLineBearing(GeoLocation location) {
double dLon = radians(location.getLongitude() - getLongitude());
double dPhi = log(tan(radians(location.getLatitude()) / 2 + pi / 4) /
tan(radians(getLatitude()) / 2 + pi / 4));
if (dLon.abs() > pi) dLon = dLon > 0 ? -(2 * pi - dLon) : (2 * pi + dLon);
return degrees(atan2(dLon, dPhi));
}