1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Fixed World Magnetic Model to accept altitude in meters instead of kilometers

This commit is contained in:
Werner Backes 2012-07-31 00:18:10 +02:00
parent 51b7e11160
commit b8450d4a07
2 changed files with 2 additions and 2 deletions

View File

@ -242,7 +242,7 @@ int WMM_GetMagVector(float Lat, float Lon, float AltEllipsoid, uint16_t Month, u
{
CoordGeodetic->lambda = Lon;
CoordGeodetic->phi = Lat;
CoordGeodetic->HeightAboveEllipsoid = AltEllipsoid;
CoordGeodetic->HeightAboveEllipsoid = AltEllipsoid/1000.0; // convert to km
// Convert from geodeitic to Spherical Equations: 17-18, WMM Technical report
if (WMM_GeodeticToSpherical(CoordGeodetic, CoordSpherical) < 0)

View File

@ -158,7 +158,7 @@ namespace Utils {
{
double Lat = LLA[0];
double Lon = LLA[1];
double AltEllipsoid = LLA[2];
double AltEllipsoid = LLA[2]/1000.0; // convert to km
// ***********
// range check supplied params