NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
NEDtoAER.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
35
37{
46 [[nodiscard]] inline reference_frames::AER NEDtoAER(const reference_frames::NED& target) noexcept
47 {
48 const auto hypotXy = std::hypot(target.x, target.y);
49 const auto el = -std::atan2(target.z, hypotXy);
50 const auto az = wrap2Pi(std::atan2(target.y, target.x));
51 const auto r = std::hypot(target.x, target.y);
52 const auto range = std::hypot(r, target.z);
53 return { az, el, range };
54 }
55} // namespace nc::coordinates::transforms
Az, El, Range coordinates.
Definition: AER.hpp:42
North east down coordinates.
Definition: NED.hpp:40
Definition: AERtoECEF.hpp:38
reference_frames::AER NEDtoAER(const reference_frames::NED &target) noexcept
Converts the Cartesian XYZ (NED) coordinates to 2d speherical inertial coordinates....
Definition: NEDtoAER.hpp:46
double wrap2Pi(dtype inAngle) noexcept
Wrap the input angle to [0, 2*pi].
Definition: wrap2Pi.hpp:43
double hypot(dtype inValue1, dtype inValue2) noexcept
Definition: hypot.hpp:56