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