Fix longitude sign convention of geocentric routines

(derived from the Williams aviation formulary, with W longitude +ve)
This commit is contained in:
James Turner
2010-06-11 18:38:43 +02:00
parent b9496fef1d
commit 0c8c596ee5

View File

@@ -509,15 +509,16 @@ SGGeodesy::advanceRadM(const SGGeoc& geoc, double course, double distance,
result.setLongitudeRad(geoc.getLongitudeRad());
} else {
double tmp = SGMiscd::clip(sin(course) * sinDistance / cosLat, -1, 1);
double lon = SGMiscd::normalizeAngle(geoc.getLongitudeRad() - asin( tmp ));
result.setLongitudeRad(lon);
double lon = SGMiscd::normalizeAngle(-geoc.getLongitudeRad() - asin( tmp ));
result.setLongitudeRad(-lon);
}
}
double
SGGeodesy::courseRad(const SGGeoc& from, const SGGeoc& to)
{
double diffLon = to.getLongitudeRad() - from.getLongitudeRad();
//double diffLon = to.getLongitudeRad() - from.getLongitudeRad();
double diffLon = from.getLongitudeRad() - to.getLongitudeRad();
double sinLatFrom = sin(from.getLatitudeRad());
double cosLatFrom = cos(from.getLatitudeRad());