NumCpp  2.18.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Loading...
Searching...
No Matches
AER.hpp
Go to the documentation of this file.
1
29#pragma once
30
31#include <iostream>
32
33#include "NumCpp/NdArray.hpp"
35
37{
41
42 class AER
43 {
44 public:
45 double az{ 0. }; // radians
46 double el{ 0. }; // radians
47 double range{ 0. }; // meters
48
52 AER() = default;
53
60 // NOTLINTNEXTLINE(bugprone-easily-swappable-parameters)
61 constexpr AER(double inAz, double inEl, double inRange = 1.) noexcept :
62 az(inAz),
63 el(inEl),
64 range(inRange)
65 {
66 }
67
72 [[nodiscard]] NdArray<double> toNdArray() const
73 {
74 NdArray<double> returnArray = { az, el, range };
75 return returnArray.transpose();
76 }
77
84 bool operator==(const AER& other) const noexcept
85 {
86 return utils::essentiallyEqual(az, other.az) && utils::essentiallyEqual(el, other.el) &&
87 utils::essentiallyEqual(range, other.range);
88 }
89
96 bool operator!=(const AER& other) const noexcept
97 {
98 return !(*this == other);
99 }
100 };
101
108 inline std::ostream& operator<<(std::ostream& os, const AER& point)
109 {
110 os << "AER(az=" << point.az << ", el=" << point.el << ", range=" << point.range << ")\n";
111 return os;
112 }
113
114} // namespace nc::coordinates::reference_frames
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:135
self_type transpose() const
Definition NdArrayCore.hpp:4959
Az, El, Range coordinates.
Definition AER.hpp:43
constexpr AER(double inAz, double inEl, double inRange=1.) noexcept
Constructor.
Definition AER.hpp:61
double el
Definition AER.hpp:46
bool operator!=(const AER &other) const noexcept
Non-Equality Operator.
Definition AER.hpp:96
AER()=default
Default Constructor.
double az
Definition AER.hpp:45
NdArray< double > toNdArray() const
Convert to NdArray.
Definition AER.hpp:72
bool operator==(const AER &other) const noexcept
Non-Equality Operator.
Definition AER.hpp:84
double range
Definition AER.hpp:47
std::ostream & operator<<(std::ostream &os, const AER &point)
Stream operator.
Definition AER.hpp:108
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition essentiallyEqual.hpp:47