NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
NEDUnitVecsInECEF.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
35
37{
45 [[nodiscard]] inline std::array<Vec3, 3> NEDUnitVecsInECEF(const reference_frames::ECEF& location) noexcept
46 {
47 const auto lla = ECEFtoLLA(location);
48
49 const auto sinLat = std::sin(lla.latitude);
50 const auto cosLat = std::cos(lla.latitude);
51 const auto sinLon = std::sin(lla.longitude);
52 const auto cosLon = std::cos(lla.longitude);
53
54 const auto xHat = Vec3{ -cosLon * sinLat, -sinLon * sinLat, cosLat };
55 const auto yHat = Vec3{ -sinLon, cosLon, 0. };
56 const auto zHat = Vec3{ -cosLon * cosLat, -sinLon * cosLat, -sinLat };
57
58 return { xHat, yHat, zHat };
59 }
60} // namespace nc::coordinates::transforms
Holds a 3D vector.
Definition: Vec3.hpp:51
ECEF coordinates.
Definition: ECEF.hpp:40
Definition: AERtoECEF.hpp:38
reference_frames::LLA ECEFtoLLA(const reference_frames::ECEF &ecef, double tol=1e-8) noexcept
Converts ECEF coordinates to LLA https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_...
Definition: ECEFtoLLA.hpp:49
std::array< Vec3, 3 > NEDUnitVecsInECEF(const reference_frames::ECEF &location) noexcept
get the local NED unit vectors wrt the ECEF coordinate system https://gssc.esa.int/navipedia/index....
Definition: NEDUnitVecsInECEF.hpp:45
auto sin(dtype inValue) noexcept
Definition: sin.hpp:49
auto cos(dtype inValue) noexcept
Definition: cos.hpp:49