27template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
30 return R_E * std::sqrt(std::pow(std::cos(latitude), 2) + std::pow((1.0 - e_squared) * std::sin(latitude), 2));
40template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
43 Scalar k = std::sqrt(1 - e_squared * std::pow(std::sin(latitude), 2));
46 return a * (1 - e_squared) / std::pow(k, 3);
56template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
60 return a / std::sqrt(1 - e_squared * std::pow(std::sin(latitude), 2));
69template<
typename Derived>
71 const typename Derived::Scalar& R_N,
const typename Derived::Scalar& R_E)
73 return Eigen::DiagonalMatrix<typename Derived::Scalar, 3>{ 1.0 / (R_N + lla_position(2)),
74 1.0 / ((R_E + lla_position(2)) * std::cos(lla_position(0))),
86template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
90 Scalar dLat = lat2 - lat1;
91 Scalar dLon = lon2 - lon1;
92 Scalar a = std::pow(std::sin(dLat / 2.0), 2) + std::cos(lat1) * std::cos(lat2) * std::pow(std::sin(dLon / 2.0), 2);
93 Scalar c = 2.0 * std::atan2(std::sqrt(a), std::sqrt(1.0 - a));
105template<
typename Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<Scalar>>>
108 if (lat1 == lat2 && lon1 == lon2)
121 Scalar P = (beta1 + beta2) / 2;
122 Scalar Q = (beta2 - beta1) / 2;
124 Scalar X = (sigma - std::sin(sigma)) * std::pow((std::sin(P) * std::cos(Q)) / std::cos(sigma / 2), 2);
125 Scalar Y = (sigma + std::sin(sigma)) * std::pow((std::cos(P) * std::sin(Q)) / std::sin(sigma / 2), 2);
Scalar calcEarthRadius_E(const Scalar &latitude, const Scalar &a=InsConst< Scalar >::WGS84::a, const Scalar &e_squared=InsConst<>::WGS84::e_squared)
Calculates the East/West (prime vertical) earth radius.
Definition Ellipsoid.hpp:57
Scalar calcEarthRadius_N(const Scalar &latitude, const Scalar &a=InsConst<>::WGS84::a, const Scalar &e_squared=InsConst<>::WGS84::e_squared)
Calculates the North/South (meridian) earth radius.
Definition Ellipsoid.hpp:41
Scalar calcGeographicalDistance(Scalar lat1, Scalar lon1, Scalar lat2, Scalar lon2)
Measure the distance between two points over an ellipsoidal-surface.
Definition Ellipsoid.hpp:106
Eigen::Matrix3< typename Derived::Scalar > conversionMatrixCartesianCurvilinear(const Eigen::MatrixBase< Derived > &lla_position, const typename Derived::Scalar &R_N, const typename Derived::Scalar &R_E)
Conversion matrix between cartesian and curvilinear perturbations to the position.
Definition Ellipsoid.hpp:70
Scalar calcGeocentricRadius(const Scalar &latitude, const Scalar &R_E, const Scalar &e_squared=InsConst< Scalar >::WGS84::e_squared)
r_eS^e The distance of a point on the Earth's surface from the center of the Earth
Definition Ellipsoid.hpp:28
Scalar calcGreatCircleDistance(Scalar lat1, Scalar lon1, Scalar lat2, Scalar lon2)
Measure the distance between two points on a sphere.
Definition Ellipsoid.hpp:87
Constants.
Definition Constants.hpp:26