NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
ECEFtoAER.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
38
40{
49 [[nodiscard]] inline reference_frames::AER ECEFtoAER(const reference_frames::ECEF& target,
50 const reference_frames::LLA& referencePoint) noexcept
51 {
52 const auto targetENU = ECEFtoENU(target, referencePoint);
53 const auto targetENUnormalizedCart =
54 normalize(Cartesian{ targetENU.east(), targetENU.north(), targetENU.up() });
55 const auto& east = targetENUnormalizedCart.x;
56 const auto& north = targetENUnormalizedCart.y;
57 const auto& up = targetENUnormalizedCart.z;
58
59 const auto referencePointECEF = LLAtoECEF(referencePoint);
60 const auto range = norm(target - referencePointECEF);
61
62 return { wrap2Pi(std::atan2(east, north)), std::asin(up), range };
63 }
64
73 [[nodiscard]] inline reference_frames::AER ECEFtoAER(const reference_frames::ECEF& target,
74 const reference_frames::ECEF& referencePoint) noexcept
75 {
76 return ECEFtoAER(target, ECEFtoLLA(referencePoint));
77 }
78} // namespace nc::coordinates::transforms
Cartensian coordinates.
Definition: Cartesian.hpp:45
double x
Definition: Cartesian.hpp:47
Az, El, Range coordinates.
Definition: AER.hpp:42
ECEF coordinates.
Definition: ECEF.hpp:40
Geodetic coordinates.
Definition: LLA.hpp:40
Definition: AERtoECEF.hpp:38
reference_frames::ECEF LLAtoECEF(const reference_frames::LLA &point) noexcept
Converts the LLA coordinates to ECEF https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#F...
Definition: LLAtoECEF.hpp:46
reference_frames::ENU ECEFtoENU(const reference_frames::ECEF &target, const reference_frames::LLA &referencePoint) noexcept
Converts the ECEF coordinates to ENU https://apps.dtic.mil/sti/pdfs/AD1170763.pdf Figure 11 https://a...
Definition: ECEFtoENU.hpp:49
reference_frames::AER ECEFtoAER(const reference_frames::ECEF &target, const reference_frames::LLA &referencePoint) noexcept
Converts the LLA coordinates to Az El with geodedic up https://geospace-code.github....
Definition: ECEFtoAER.hpp:49
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
double norm(const Cartesian &vec) noexcept
Vector norm.
Definition: Cartesian.hpp:295
Cartesian normalize(const Cartesian &vec) noexcept
normalize the input vector
Definition: Cartesian.hpp:306
double wrap2Pi(dtype inAngle) noexcept
Wrap the input angle to [0, 2*pi].
Definition: wrap2Pi.hpp:43