NumCpp  2.18.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
cart2sph.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
34
36{
43 [[nodiscard]] inline reference_frames::AER cart2sph(const Cartesian& cartesian) noexcept
44 {
45 const auto hxy = std::hypot(cartesian.x, cartesian.y);
46 const auto range = std::hypot(hxy, cartesian.z);
47 const auto elevation = std::atan2(cartesian.z, hxy);
48 const auto azimuth = std::atan2(cartesian.y, cartesian.x);
49 return reference_frames::AER{ azimuth, elevation, range };
50 }
51} // namespace nc::coordinates::transforms
Cartensian coordinates.
Definition Cartesian.hpp:44
Az, El, Range coordinates.
Definition AER.hpp:43
Definition AERtoECEF.hpp:38
reference_frames::AER cart2sph(const Cartesian &cartesian) noexcept
Converts cartiesian coordinates to spherical coordinates.
Definition cart2sph.hpp:43