8#ifndef META_OCEAN_MATH_EULER_H
9#define META_OCEAN_MATH_EULER_H
31template <
typename T>
class EulerT;
139 inline const T&
yaw()
const;
182 std::string
toString(
const bool inDegree =
false)
const;
291 ocean_assert(arrayValue);
292 memcpy(
values_, arrayValue,
sizeof(T) * 3);
393 return !(*
this == euler);
399 ocean_assert(index < 3u);
406 ocean_assert(index < 3u);
413 ocean_assert(index < 3u);
420 ocean_assert(index < 3u);
This class implements an euler rotation with angles: yaw, pitch and roll.
Definition Euler.h:82
EulerT()
Creates a new Euler rotation with all angles zero.
Definition Euler.h:273
static void decomposeRotationMatrixToXYZ(const SquareMatrixT3< T > &matrix, T &xAngle, T &yAngle, T &zAngle)
Decomposes a 3x3 rotation matrix to the corresponding x, y and z angles.
Definition Euler.h:506
T & yaw()
Returns the yaw angle.
Definition Euler.h:330
const Scalar & yaw() const
T & roll()
Returns the roll angle.
Definition Euler.h:354
const T * operator()() const
Access operator.
Definition Euler.h:425
Scalar values_[3]
Definition Euler.h:269
const T & operator[](const unsigned int index) const
Element access operator.
Definition Euler.h:397
const Scalar & roll() const
bool operator!=(const EulerT< T > &euler) const
Returns whether two euler rotations are not identical up to a small epsilon.
Definition Euler.h:391
const T & operator()(const unsigned int index) const
Element access operator.
Definition Euler.h:411
EulerT(const SquareMatrixT3< T > &matrix)
Creates a new euler rotation by a given 3x3 matrix rotation.
Definition Euler.h:317
EulerT(const QuaternionT< T > &quaternion)
Creates a new euler rotation by a given quaternion rotation.
Definition Euler.h:310
T & operator()(const unsigned int index)
Element access operator.
Definition Euler.h:418
static void decomposeRotationMatrixToYXZ(const SquareMatrixT3< T > &matrix, T &yAngle, T &xAngle, T &zAngle)
Decomposes a 3x3 rotation matrix to the corresponding yaw, pitch and roll angles as defined by the eu...
Definition Euler.h:437
T & operator[](const unsigned int index)
Element access operator.
Definition Euler.h:404
EulerT(const T *arrayValue)
Creates a new euler rotation by an array of angles.
Definition Euler.h:289
bool isValid() const
Returns whether the euler rotation holds valid parameters.
Definition Euler.h:360
EulerT(const HomogenousMatrixT4< T > &transformation)
Creates a new euler rotation by a given homogeneous transformation.
Definition Euler.h:296
T * operator()()
Access operator.
Definition Euler.h:431
T & pitch()
Returns the pitch angle.
Definition Euler.h:342
std::string toString(const bool inDegree=false) const
Returns the euler rotation as string.
Definition Euler.h:368
Scalar Type
Definition Euler.h:88
const Scalar & pitch() const
EulerT(const T yaw, const T pitch, const T roll)
Creates a new euler rotation by given angles.
Definition Euler.h:281
EulerT(const RotationT< T > &rotation)
Creates a new euler rotation by a given angle-axis rotation.
Definition Euler.h:303
static void adjustAngles(T &yaw, T &pitch, T &roll)
Adjusts euler angles with arbitrary value (e.g., outside the valid value range) to euler angles withi...
Definition Euler.h:575
bool operator==(const EulerT< T > &euler) const
Returns whether two euler rotations are identical up to a small epsilon.
Definition Euler.h:385
This class implements a 4x4 homogeneous transformation matrix using floating point values with the pr...
Definition HomogenousMatrix4.h:110
SquareMatrixT3< T > orthonormalRotationMatrix() const
Returns the 3x3 orthonormal rotation matrix of the 4x4 transformation (by forcing a orthogonal and no...
Definition HomogenousMatrix4.h:1532
static constexpr bool isInsideRange(const T lower, const T value, const T upper, const T epsilon=NumericT< T >::eps())
Returns whether a value lies between a given range up to a provided epsilon border.
Definition Numeric.h:2881
static constexpr T pi_2()
Returns PI/2 which is equivalent to 90 degree.
Definition Numeric.h:938
static T atan2(const T y, const T x)
Returns the arctangent of a given value in radian.
Definition Numeric.h:1636
static T abs(const T value)
Returns the absolute value of a given value.
Definition Numeric.h:1220
static constexpr T pi()
Returns PI which is equivalent to 180 degree.
Definition Numeric.h:926
static bool isWeakEqual(const T first, const T second)
Returns whether two values a equal up to a weak epsilon.
Definition Numeric.h:2581
static T angleAdjustNull(const T angle)
Adjusts an arbitrary angle into the range of (-PI, PI].
Definition Numeric.h:1800
static constexpr T eps()
Returns a small epsilon.
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2395
static constexpr T copySign(const T signReceiver, const T signProvider)
Copies the sign of a given value to another one.
Definition Numeric.h:3273
static constexpr T rad2deg(const T rad)
Converts rad to deg.
Definition Numeric.h:3247
static constexpr bool isNotEqualEps(const T value)
Returns whether a value is not smaller than or equal to a small epsilon.
Definition Numeric.h:2246
static T asin(const T value)
Returns the arcsine of a given value.
Definition Numeric.h:2896
This class implements a unit quaternion rotation.
Definition Quaternion.h:100
This class implements a axis-angle rotation using floating point values.
Definition Rotation.h:73
This class implements a 3x3 square matrix.
Definition SquareMatrix3.h:89
bool isOrthonormal(const T epsilon=NumericT< T >::eps()) const
Returns whether this matrix is an orthonormal matrix.
Definition SquareMatrix3.h:1366
static std::string toAString(const char value)
Converts a value to a string with 8bit character.
EulerT< Scalar > Euler
Definition of the Euler object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Euler.h:38
std::vector< Euler > Eulers
Definition of a vector holding euler objects.
Definition Euler.h:67
EulerT< double > EulerD
Instantiation of the EulerT template class using a double precision float data type.
Definition Euler.h:45
std::vector< EulerT< T > > EulersT
Definition of a typename alias for vectors with EulerT objects.
Definition Euler.h:60
EulerT< float > EulerF
Instantiation of the EulerT template class using a single precision float data type.
Definition Euler.h:52
The namespace covering the entire Ocean framework.
Definition Accessor.h:15