20 #ifndef ANTKEEPER_PHYSICS_ORBIT_FRAME_HPP
21 #define ANTKEEPER_PHYSICS_ORBIT_FRAME_HPP
44 const T xx_yy = v.x() * v.x() + v.y() * v.y();
50 std::atan2(v.y(), v.x())
66 const T x = a * (std::cos(ea) - ec);
67 const T y = b * std::sin(ea);
69 const T ta = std::atan2(y, x);
85 const T b = a *
std::sqrt(T(1) - ec * ec);
86 return spherical<T>(ec, a, ea, b);
98 const T x = v[0] * std::cos(v[1]);
104 v[0] * std::sin(v[1]),
120 return cartesian<T>(spherical<T>(ec, a, ea, b));
134 return cartesian<T>(spherical<T>(ec, a, ea));
145 template <
typename T>
172 const T x = v[0] * std::cos(v[1]);
178 v[0] * std::sin(v[1]),
191 const T xx_yy = v.x() * v.x() + v.y() * v.y();
197 std::atan2(v.y(), v.x())
212 template <
typename T>
233 template <
typename T>
260 const T x = v[0] * std::cos(v[1]);
266 v[0] * std::sin(v[1]),
279 const T xx_yy = v.x() * v.x() + v.y() * v.y();
285 std::atan2(v.y(), v.x())
300 template <
typename T>
322 template <
typename T>
349 const T x = v[0] * std::cos(v[1]);
350 const T y = math::half_pi<T> - v[2];
356 v[0] * std::sin(v[1]),
369 const T xx_yy = v.x() * v.x() + v.y() * v.y();
375 math::half_pi<T> - std::atan2(v.y(), v.x())
387 template <
typename T>
quaternion< T > normalize(const quaternion< T > &q)
Normalizes a quaternion.
T distance(const vector< T, N > &p0, const vector< T, N > &p1)
Calculates the distance between two points.
vector< T, N > sqrt(const vector< T, N > &x)
Takes the square root of each element.
math::se3< T > to_bci(T ra, T dec, T w)
Constructs an SE(3) transformation from a BCBF frame to a BCI frame.
math::vec3< T > cartesian(const math::vec3< T > &v)
Converts BCBF coordinates from spherical to Cartesian.
math::vec3< T > spherical(const math::vec3< T > &v)
Converts BCBF coordinates from Cartesian to spherical.
math::se3< T > to_enu(T distance, T latitude, T longitude)
Constructs an SE(3) transformation from a BCBF frame to an ENU frame.
math::se3< T > to_pqw(T om, T in, T w)
Constructs an SE(3) transformation from a BCI frame to a PQW frame.
math::se3< T > to_bcbf(T ra, T dec, T w)
Constructs an SE(3) transformation from a BCI frame to a BCBF frame.
math::vec3< T > cartesian(const math::vec3< T > &v)
Converts BCI coordinates from spherical to Cartesian.
math::vec3< T > spherical(const math::vec3< T > &v)
Converts BCI coordinates from Cartesian to spherical.
math::vec3< T > spherical(const math::vec3< T > &v)
Converts ENU coordinates from Cartesian to spherical.
math::se3< T > to_bcbf(T distance, T latitude, T longitude)
Constructs an SE(3) transformation from an ENU frame to a BCBF frame.
math::vec3< T > cartesian(const math::vec3< T > &v)
Converts ENU coordinates from spherical to Cartesian.
math::vec3< T > spherical(const math::vec3< T > &v)
Converts PQW coordinates from Cartesian to spherical.
math::vec3< T > cartesian(const math::vec3< T > &v)
Converts PQW coordinates from spherical to Cartesian.
math::se3< T > to_bci(T om, T in, T w)
Constructs an SE(3) transformation from a PQW frame to a BCI frame.
Quaternion composed of a real scalar part and imaginary vector part.
SE(3) proper rigid transformation (rototranslation).