51 constexpr int MAX_ITER = 10;
56 const auto lon = std::atan2(ecef.
y, ecef.
x);
73 while (err > tol && iter < MAX_ITER)
77 lat = std::atan((ecef.
z / p) / (1 - (N * E_SQR / (N + alt))));
78 double newAlt = (p /
std::cos(lat)) - N;
84 return { lat, lon, alt };
double z
Definition: Cartesian.hpp:49
double y
Definition: Cartesian.hpp:48
double x
Definition: Cartesian.hpp:47
ECEF coordinates.
Definition: ECEF.hpp:40
Geodetic coordinates.
Definition: LLA.hpp:40
constexpr double pi
Pi.
Definition: Core/Constants.hpp:39
constexpr double e
eulers number
Definition: Core/Constants.hpp:37
constexpr double EARTH_POLAR_RADIUS
Definition: Coordinates/ReferenceFrames/Constants.hpp:33
constexpr double EARTH_EQUATORIAL_RADIUS
Definition: Coordinates/ReferenceFrames/Constants.hpp:34
constexpr dtype sqr(dtype inValue) noexcept
Definition: sqr.hpp:42
auto sin(dtype inValue) noexcept
Definition: sin.hpp:49
double hypot(dtype inValue1, dtype inValue2) noexcept
Definition: hypot.hpp:56
int8 sign(dtype inValue) noexcept
Definition: sign.hpp:52
auto abs(dtype inValue) noexcept
Definition: abs.hpp:49
auto cos(dtype inValue) noexcept
Definition: cos.hpp:49
auto sqrt(dtype inValue) noexcept
Definition: sqrt.hpp:48