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
32
#include "
NumCpp/Coordinates/Cartesian.hpp
"
33
#include "
NumCpp/Coordinates/ReferenceFrames/AER.hpp
"
34
35
namespace
nc::coordinates::transforms
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
AER.hpp
Cartesian.hpp
nc::coordinates::Cartesian
Cartensian coordinates.
Definition
Cartesian.hpp:44
nc::coordinates::reference_frames::AER
Az, El, Range coordinates.
Definition
AER.hpp:43
nc::coordinates::transforms
Definition
AERtoECEF.hpp:38
nc::coordinates::transforms::cart2sph
reference_frames::AER cart2sph(const Cartesian &cartesian) noexcept
Converts cartiesian coordinates to spherical coordinates.
Definition
cart2sph.hpp:43
include
NumCpp
Coordinates
Transforms
cart2sph.hpp
Generated by
1.15.0