NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
LLA.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <iostream>
31
33
35{
39 class LLA
40 {
41 public:
42 double latitude{ 0. }; // radians
43 double longitude{ 0. }; // radians
44 double altitude{ 0. }; // meters
45
49 LLA() = default;
50
57 // NOTLINTNEXTLINE(bugprone-easily-swappable-parameters)
58 constexpr LLA(double inLatitude, double inLongitude, double inAltitude = 0.) noexcept :
59 latitude(inLatitude),
60 longitude(inLongitude),
61 altitude(inAltitude)
62 {
63 }
64
71 bool operator==(const LLA& other) const noexcept
72 {
73 return utils::essentiallyEqual(latitude, other.latitude) &&
74 utils::essentiallyEqual(longitude, other.longitude) &&
75 utils::essentiallyEqual(altitude, other.altitude);
76 }
77
84 bool operator!=(const LLA& other) const noexcept
85 {
86 return !(*this == other);
87 }
88 };
89
96 inline std::ostream& operator<<(std::ostream& os, const LLA& point)
97 {
98 os << "LLA(latitude=" << point.latitude << ", longitude=" << point.longitude << ", altitude=" << point.altitude
99 << ")\n";
100 return os;
101 }
102} // namespace nc::coordinates::reference_frames
Geodetic coordinates.
Definition: LLA.hpp:40
double longitude
Definition: LLA.hpp:43
constexpr LLA(double inLatitude, double inLongitude, double inAltitude=0.) noexcept
Constructor.
Definition: LLA.hpp:58
bool operator!=(const LLA &other) const noexcept
Non-Equality Operator.
Definition: LLA.hpp:84
double altitude
Definition: LLA.hpp:44
double latitude
Definition: LLA.hpp:42
LLA()=default
Default Constructor.
bool operator==(const LLA &other) const noexcept
Non-Equality Operator.
Definition: LLA.hpp:71
Definition: AER.hpp:36
std::ostream & operator<<(std::ostream &os, const AER &point)
Stream operator.
Definition: AER.hpp:97
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:49