Go to the documentation of this file.
38 double s = sin(lambda);
39 double N =
a / sqrt(1 -
e_sq * s * s);
41 double sin_lambda = sin(lambda);
42 double cos_lambda = cos(lambda);
43 double cos_phi = cos(phi);
44 double sin_phi = sin(phi);
46 xEcef = (h + N) * cos_lambda * cos_phi;
47 yEcef = (h + N) * cos_lambda * sin_phi;
48 zEcef = (h + (1 -
e_sq) * N) * sin_lambda;
61 double s = sin(lambda);
62 double N =
a / sqrt(1 -
e_sq * s * s);
64 double sin_lambda = sin(lambda);
65 double cos_lambda = cos(lambda);
66 double cos_phi = cos(phi);
67 double sin_phi = sin(phi);
69 double x0 = (h0 + N) * cos_lambda * cos_phi;
70 double y0 = (h0 + N) * cos_lambda * sin_phi;
71 double z0 = (h0 + (1 -
e_sq) * N) * sin_lambda;
79 xEast = -sin_phi * xd + cos_phi * yd;
80 yNorth = -cos_phi * sin_lambda * xd - sin_lambda * sin_phi * yd +
82 zUp = cos_lambda * cos_phi * xd + cos_lambda * sin_phi * yd +
91 double lon0,
double h0)
102 return (d * d) < 1e-2;
double yEcef
Earth-Centered Earth-Fixed (ECEF) coordinates y.
double xEast
East-North-Up coordinates x in a Local Tangent Plane.
double e_sq
Square of Eccentricity.
void EcefToEnu(double lat0, double lon0, double h0)
Converts the Earth-Centered Earth-Fixed (ECEF) coordinates (x, y, z) to East-North-Up coordinates in ...
double RadiansToDegrees(double radians)
convert radians to degrees
Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cart...
double yNorth
East-North-Up coordinates y in a Local Tangent Plane.
bool AreClose(double x0, double x1)
check whether two values are too close (less than 1e-2)
double a
WGS-84 Earth semimajor axis (m)
double f
Ellipsoid Flatness.
double xEcef
Earth-Centered Earth-Fixed (ECEF) coordinates x.
double b
WGS-84 Earth semiminor axis (m)
double DegreesToRadians(double degrees)
convert degrees to radians
double zEcef
Earth-Centered Earth-Fixed (ECEF) coordinates z.
void GeodeticToEcef(double lat, double lon, double h)
Converts WGS-84 Geodetic point (lat, lon, h) to the Earth-Centered Earth-Fixed (ECEF) coordinates (x,...
void GeodeticToEnu(double lat, double lon, double h, double lat0, double lon0, double h0)
Converts the geodetic WGS-84 coordinated (lat, lon, h) to East-North-Up coordinates in a Local Tangen...
double zUp
East-North-Up coordinates z in a Local Tangent Plane.