NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
Orientation.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <iostream>
31
33
34namespace nc::coordinates
35{
40 {
41 public:
42 double roll{ 0. };
43 double pitch{ 0. };
44 double yaw{ 0. };
45
49 Orientation() noexcept = default;
50
58 constexpr Orientation(double inRoll, double inPitch, double inYaw) noexcept :
59 roll(inRoll),
60 pitch(inPitch),
61 yaw(inYaw)
62 {
63 }
64
70 Orientation(const Orientation& other) noexcept = default;
71
77 Orientation(Orientation&& other) noexcept = default;
78
82 virtual ~Orientation() = default;
83
89 Orientation& operator=(const Orientation& other) noexcept = default;
90
96 Orientation& operator=(Orientation&& other) noexcept = default;
97
104 bool operator==(const Orientation& other) const noexcept
105 {
106 return utils::essentiallyEqual(roll, other.roll) && utils::essentiallyEqual(pitch, other.pitch) &&
107 utils::essentiallyEqual(yaw, other.yaw);
108 }
109
116 bool operator!=(const Orientation& other) const noexcept
117 {
118 return !(*this == other);
119 }
120 };
121
128 inline std::ostream& operator<<(std::ostream& os, const Orientation& orientation)
129 {
130 os << "Orientation(roll=" << orientation.roll << ", pitch=" << orientation.pitch << ", yaw=" << orientation.yaw
131 << ")\n";
132 return os;
133 }
134} // namespace nc::coordinates
Orientation.
Definition: Orientation.hpp:40
Orientation() noexcept=default
Default Constructor.
Orientation & operator=(Orientation &&other) noexcept=default
Move Assignement Operator.
bool operator!=(const Orientation &other) const noexcept
Non-Equality Operator.
Definition: Orientation.hpp:116
Orientation(const Orientation &other) noexcept=default
Copy Constructor.
Orientation & operator=(const Orientation &other) noexcept=default
Copy Assignement Operator.
double roll
Definition: Orientation.hpp:42
virtual ~Orientation()=default
Destructor.
Orientation(Orientation &&other) noexcept=default
Move Orientation.
bool operator==(const Orientation &other) const noexcept
Non-Equality Operator.
Definition: Orientation.hpp:104
double pitch
Definition: Orientation.hpp:43
double yaw
Definition: Orientation.hpp:44
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:49