NumCpp  2.11.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
NEDUnitVecsInECEF.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #include <cmath>
31 
34 #include "NumCpp/Vector/Vec3.hpp"
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
std::array< Vec3, 3 > NEDUnitVecsInECEF(const reference_frames::ECEF &location) noexcept
get&#160;the&#160;local&#160;NED&#160;unit&#160;vectors&#160;wrt&#160;the&#160;ECEF&#160;coordinate&#160;system https://gssc.esa.int/navipedia/index....
Definition: NEDUnitVecsInECEF.hpp:45
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
auto sin(dtype inValue) noexcept
Definition: sin.hpp:49
auto cos(dtype inValue) noexcept
Definition: cos.hpp:49