NumCpp  2.11.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
Euler.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #include <iostream>
31 
33 
34 namespace nc::coordinates
35 {
39  class Euler
40  {
41  public:
42  double psi{ 0. };
43  double theta{ 0. };
44  double phi{ 0. };
45 
49  Euler() noexcept = default;
50 
58  constexpr Euler(double inPsi, double inTheta, double inPhi) noexcept :
59  psi(inPsi),
60  theta(inTheta),
61  phi(inPhi)
62  {
63  }
64 
70  Euler(const Euler& other) noexcept = default;
71 
77  Euler(Euler&& other) noexcept = default;
78 
82  virtual ~Euler() = default;
83 
89  Euler& operator=(const Euler& other) noexcept = default;
90 
96  Euler& operator=(Euler&& other) noexcept = default;
97 
104  bool operator==(const Euler& other) const noexcept
105  {
106  return utils::essentiallyEqual(psi, other.psi) && utils::essentiallyEqual(theta, other.theta) &&
107  utils::essentiallyEqual(phi, other.phi);
108  }
109 
116  bool operator!=(const Euler& other) const noexcept
117  {
118  return !(*this == other);
119  }
120  };
121 
128  inline std::ostream& operator<<(std::ostream& os, const Euler& Euler)
129  {
130  os << "Euler(psi=" << Euler.psi << ", theta=" << Euler.theta << ", phi=" << Euler.phi << ")\n";
131  return os;
132  }
133 } // namespace nc::coordinates
Euler.
Definition: Euler.hpp:40
double phi
Definition: Euler.hpp:44
bool operator==(const Euler &other) const noexcept
Non-Equality Operator.
Definition: Euler.hpp:104
virtual ~Euler()=default
Destructor.
bool operator!=(const Euler &other) const noexcept
Non-Equality Operator.
Definition: Euler.hpp:116
Euler() noexcept=default
Default Constructor.
Euler(const Euler &other) noexcept=default
Copy Constructor.
double psi
Definition: Euler.hpp:42
Euler & operator=(Euler &&other) noexcept=default
Move Assignement Operator.
Euler(Euler &&other) noexcept=default
Move Euler.
double theta
Definition: Euler.hpp:43
Euler & operator=(const Euler &other) noexcept=default
Copy Assignement Operator.
Definition: Cartesian.hpp:40
std::ostream & operator<<(std::ostream &os, const Cartesian &vec)
Stream operator.
Definition: Cartesian.hpp:269
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:48