33#include <NDEVR/BaseValues.h>
34#include <NDEVR/Vector.h>
35#include <NDEVR/Angle.h>
38 template<u
int01 t_cols, u
int01 t_rows>
45 template<
class t_type>
56 template<
class t_type>
59 return value[0][0] * value[1][1] - value[1][0] * value[0][1];
61 template<
class t_type>
64 t_type OneOverDeterminant =
static_cast<t_type
>(1) / value.determinant();
66 +value[1][1] * OneOverDeterminant,
67 -value[0][1] * OneOverDeterminant,
68 -value[1][0] * OneOverDeterminant,
69 +value[0][0] * OneOverDeterminant).
template getAs<t_type, 2, 2>();
77 template<
class t_type>
80 return + value[0][0] * (value[1][1] * value[2][2] - value[2][1] * value[1][2])
81 - value[1][0] * (value[0][1] * value[2][2] - value[2][1] * value[0][2])
82 + value[2][0] * (value[0][1] * value[1][2] - value[1][1] * value[0][2]);
84 template<
class t_type>
87 t_type OneOverDeterminant =
static_cast<t_type
>(1) / determinant(value);
89 Inverse[0][0] = +(value[1][1] * value[2][2] - value[2][1] * value[1][2]) * OneOverDeterminant;
90 Inverse[1][0] = -(value[1][0] * value[2][2] - value[2][0] * value[1][2]) * OneOverDeterminant;
91 Inverse[2][0] = +(value[1][0] * value[2][1] - value[2][0] * value[1][1]) * OneOverDeterminant;
92 Inverse[0][1] = -(value[0][1] * value[2][2] - value[2][1] * value[0][2]) * OneOverDeterminant;
93 Inverse[1][1] = +(value[0][0] * value[2][2] - value[2][0] * value[0][2]) * OneOverDeterminant;
94 Inverse[2][1] = -(value[0][0] * value[2][1] - value[2][0] * value[0][1]) * OneOverDeterminant;
95 Inverse[0][2] = +(value[0][1] * value[1][2] - value[1][1] * value[0][2]) * OneOverDeterminant;
96 Inverse[1][2] = -(value[0][0] * value[1][2] - value[1][0] * value[0][2]) * OneOverDeterminant;
97 Inverse[2][2] = +(value[0][0] * value[1][1] - value[1][0] * value[0][1]) * OneOverDeterminant;
106 template<
class t_type>
109 t_type Coef00 = value[2][2] * value[3][3] - value[3][2] * value[2][3];
110 t_type Coef02 = value[1][2] * value[3][3] - value[3][2] * value[1][3];
111 t_type Coef03 = value[1][2] * value[2][3] - value[2][2] * value[1][3];
113 t_type Coef04 = value[2][1] * value[3][3] - value[3][1] * value[2][3];
114 t_type Coef06 = value[1][1] * value[3][3] - value[3][1] * value[1][3];
115 t_type Coef07 = value[1][1] * value[2][3] - value[2][1] * value[1][3];
117 t_type Coef08 = value[2][1] * value[3][2] - value[3][1] * value[2][2];
118 t_type Coef10 = value[1][1] * value[3][2] - value[3][1] * value[1][2];
119 t_type Coef11 = value[1][1] * value[2][2] - value[2][1] * value[1][2];
121 t_type Coef12 = value[2][0] * value[3][3] - value[3][0] * value[2][3];
122 t_type Coef14 = value[1][0] * value[3][3] - value[3][0] * value[1][3];
123 t_type Coef15 = value[1][0] * value[2][3] - value[2][0] * value[1][3];
125 t_type Coef16 = value[2][0] * value[3][2] - value[3][0] * value[2][2];
126 t_type Coef18 = value[1][0] * value[3][2] - value[3][0] * value[1][2];
127 t_type Coef19 = value[1][0] * value[2][2] - value[2][0] * value[1][2];
129 t_type Coef20 = value[2][0] * value[3][1] - value[3][0] * value[2][1];
130 t_type Coef22 = value[1][0] * value[3][1] - value[3][0] * value[1][1];
131 t_type Coef23 = value[1][0] * value[2][1] - value[2][0] * value[1][1];
153 Vector<4, t_type> Row0(Inv0[0] * SignA[0], Inv1[0] * SignB[0], Inv2[0] * SignA[0], Inv3[0] * SignB[0]);
156 t_type Dot1 = Dot0.
sum();
159 t_type OneOverDeterminant =
static_cast<t_type
>(1) / Dot1;
160 Inv0 = Inv0 * SignA * OneOverDeterminant;
161 Inv1 = Inv1 * SignB * OneOverDeterminant;
162 Inv2 = Inv2 * SignA * OneOverDeterminant;
163 Inv3 = Inv3 * SignB * OneOverDeterminant;
165 { Inv0[0], Inv0[1], Inv0[2], Inv0[3] }
166 , { Inv1[0], Inv1[1], Inv1[2], Inv1[3] }
167 , { Inv2[0], Inv2[1], Inv2[2], Inv2[3]}
168 , { Inv3[0], Inv3[1], Inv3[2], Inv3[3]});
171 template<
class t_type, u
int01 t_row_dims = 4, u
int01 t_col_dims = 4>
178 constexpr explicit Matrix(
const t_type diagonal)
181 for (
uint01 i = 0; i <
getMin(t_row_dims, t_col_dims); i++)
183 (*this)[i][i] = diagonal;
188 const t_type n00,
const t_type n10,
189 const t_type n01,
const t_type n11)
191 Vector<2, t_type>(n00, n10)
192 ,
Vector<2, t_type>(n01, n11))
194 static_assert(t_row_dims == 2 && t_col_dims == 2,
"Bad Transform Constructor, should be 2x2");
197 const t_type n00,
const t_type n10,
const t_type n20,
198 const t_type n01,
const t_type n11,
const t_type n21,
199 const t_type n02,
const t_type n12,
const t_type n22)
201 Vector<3, t_type>(n00, n10, n20)
202 ,
Vector<3, t_type>(n01, n11, n21)
203 ,
Vector<3, t_type>(n02, n12, n22))
205 static_assert(t_row_dims == 3 && t_col_dims == 3,
"Bad Transform Constructor, should be 3x3");
208 const t_type n00,
const t_type n10,
const t_type n20,
const t_type n30,
209 const t_type n01,
const t_type n11,
const t_type n21,
const t_type n31,
210 const t_type n02,
const t_type n12,
const t_type n22,
const t_type n32,
211 const t_type n03,
const t_type n13,
const t_type n23,
const t_type n33)
213 Vector<4, t_type>(n00, n10, n20, n30)
214 ,
Vector<4, t_type>(n01, n11, n21, n31)
215 ,
Vector<4, t_type>(n02, n12, n22, n32)
216 ,
Vector<4, t_type>(n03, n13, n23, n33))
218 static_assert(t_row_dims == 4 && t_col_dims == 4,
"Bad Transform Constructor, should be 4x4");
220 template<
class t_angle_type>
227 (*this)[t_row_dims - 1][0] =
offset[
X];
228 if constexpr (t_col_dims >= 2)
229 (*
this)[t_row_dims - 1][1] =
offset[
Y];
230 if constexpr (t_col_dims >= 3)
231 (*
this)[t_row_dims - 1][2] =
offset[
Z];
233 *
this = this->
scale(scale);
240 :
Vector<t_row_dims,
Vector<t_col_dims, t_type>>(vector)
244 template<
class t_new_type>
248 for (
uint01 row = 0; row < t_row_dims; ++row)
250 for (
uint01 col = 0; col < t_col_dims; ++col)
257 template<u
int01 t_i0, u
int01 t_i1, u
int01 t_j0, u
int01 t_j1>
258 [[nodiscard]]
constexpr Matrix<t_type, t_i1 - t_i0 + 1, t_j1 - t_j0 + 1>
subMatrix()
const
260 Matrix<t_type, t_i1 - t_i0 + 1, t_j1 - t_j0 + 1> mat;
261 for (
uint01 i = t_i0; i <= t_i1; i++)
263 for (
uint01 j = t_j0; j <= t_j1; j++)
264 mat[i - t_i0][j - t_j0] = (*
this)[i][j];
268 template<u
int01 t_j0, u
int01 t_j1, u
int01 t_i_size>
271 Matrix<t_type, t_i_size, t_j1 - t_j0 + 1> mat;
272 for (
uint01 i = 0; i < t_i_size; i++)
274 for (
uint01 j = t_j0; j <= t_j1; j++)
276 mat[i][j - t_j0] = (*this)[r[i]][j];
281 template<
class t_new_type, u
int01 t_new_row_dims, u
int01 t_new_col_dims>
285 for (
uint01 row = 0; row <
getMin(t_row_dims, t_new_row_dims); ++row)
287 for (
uint01 col = 0; col <
getMin(t_col_dims, t_new_col_dims); ++col)
297 mat[t_row_dims - 1][0] = translation[
X];
298 if constexpr (t_col_dims >= 2)
299 mat[t_row_dims - 1][1] = translation[
Y];
300 if constexpr (t_col_dims >= 3)
301 mat[t_row_dims - 1][2] = translation[
Z];
308 if constexpr (t_col_dims >= 2 && t_row_dims >= 2)
310 if constexpr (t_col_dims >= 3 && t_row_dims >= 3)
318 if constexpr (t_col_dims >= 2 && t_row_dims >= 2)
326 if constexpr (t_col_dims >= 2 && t_row_dims >= 2)
328 if constexpr (t_col_dims >= 3 && t_row_dims >= 3)
332 template<
class t_angle_type>
335 t_type ch = t_type(1);
336 t_type sh = t_type(0);
337 t_type ca = t_type(1);
338 t_type sa = t_type(0);
339 t_type cb = t_type(1);
340 t_type sb = t_type(0);
343 ch =
cos(orientation[
YAW]);
344 sh =
sin(orientation[
YAW]);
357 t_type m00 = ch * ca;
358 t_type m01 = ch * sa * sb - sh * cb;
359 t_type m02 = ch * sa * cb + sh * sb;
360 t_type m10 = sh * ca;
361 t_type m11 = sh * sa * sb + ch * cb;
362 t_type m12 = sh * sa * cb - ch * sb;
364 t_type m21 = ca * sb;
365 t_type m22 = ca * cb;
372 template<
class t_angle_type>
375 const t_type cos_val =
cos(phi);
376 const t_type sin_val =
sin(phi);
377 const t_type x = axis[
X];
378 const t_type y = axis[
Y];
379 const t_type z = axis[
Z];
381 (cos_val + x * x * (1 - cos_val)), (z * sin_val + y * x * (1 - cos_val)), (-y * sin_val + z * x * (1 - cos_val)), 0
382 , (-z * sin_val + x * y * (1 - cos_val)), (cos_val + y * y * (1 - cos_val)), (x * sin_val + z * y * (1 - cos_val)), 0
383 , (y * sin_val + x * z * (1 - cos_val)), (-x * sin_val + y * z * (1 - cos_val)), (cos_val + z * z * (1 - cos_val)), 0
388 static_assert(t_col_dims == t_row_dims,
"Rows and columns must be equal for determinate");
392 return (*
this)[0][0];
394 return (*
this)[0][0] * (*this)[1][1] - (*this)[1][0] * (*this)[0][1];
397 +(*this)[0][0] * ((*this)[1][1] * (*this)[2][2] - (*this)[2][1] * (*this)[1][2])
398 - (*
this)[1][0] * ((*this)[0][1] * (*this)[2][2] - (*this)[2][1] * (*this)[0][2])
399 + (*
this)[2][0] * ((*this)[0][1] * (*this)[1][2] - (*this)[1][1] * (*this)[0][2]);
402 t_type SubFactor00 = (*this)[2][2] * (*this)[3][3] - (*this)[3][2] * (*this)[2][3];
403 t_type SubFactor01 = (*this)[2][1] * (*this)[3][3] - (*this)[3][1] * (*this)[2][3];
404 t_type SubFactor02 = (*this)[2][1] * (*this)[3][2] - (*this)[3][1] * (*this)[2][2];
405 t_type SubFactor03 = (*this)[2][0] * (*this)[3][3] - (*this)[3][0] * (*this)[2][3];
406 t_type SubFactor04 = (*this)[2][0] * (*this)[3][2] - (*this)[3][0] * (*this)[2][2];
407 t_type SubFactor05 = (*this)[2][0] * (*this)[3][1] - (*this)[3][0] * (*this)[2][1];
409 +((*
this)[1][1] * SubFactor00 - (*
this)[1][2] * SubFactor01 + (*
this)[1][3] * SubFactor02),
410 -((*
this)[1][0] * SubFactor00 - (*
this)[1][2] * SubFactor03 + (*
this)[1][3] * SubFactor04),
411 +((*
this)[1][0] * SubFactor01 - (*
this)[1][1] * SubFactor03 + (*
this)[1][3] * SubFactor05),
412 -((*
this)[1][0] * SubFactor02 - (*
this)[1][1] * SubFactor04 + (*
this)[1][2] * SubFactor05));
414 (*
this)[0][0] * DetCof[0] + (*this)[0][1] * DetCof[1] +
415 (*this)[0][2] * DetCof[2] + (*this)[0][3] * DetCof[3];
423 static_assert(t_col_dims >= 4 && t_row_dims >= 4,
"Cannot decompose lower dimension matrix");
426 for (
uint01 i = 0; i < 3; i++)
433 if (
dot(temp_z, rows[2]) < 0)
435 scaling[
X] = -scaling[
X];
442 static_assert(t_col_dims >= 3 && t_row_dims >= 3,
"Cannot decompose lower dimension matrix");
453 template<
class t_angle_type>
456 static_assert(t_col_dims >= 3 && t_row_dims >= 3,
"Cannot decompose lower dimension matrix");
459 for (
uint01 i = 0; i < 3; i++)
464 if (
dot(temp_z, rows[2]) < 0)
468 for (
uint04 i = 0; i < 3; i++)
472 t_type sy =
sqrt(rows[0][0] * rows[0][0] + rows[0][1] * rows[0][1]);
490 t_type trace = (*this)[0][0] + (*this)[1][1] + (*this)[2][2];
493 if (trace > t_type(0.0))
495 t_type s =
sqrt(trace + t_type(1.0));
496 temp[3] = (s * t_type(0.5));
499 temp[0] = (((*this)[2][1] - (*this)[1][2]) * s);
500 temp[1] = (((*this)[0][2] - (*this)[2][0]) * s);
501 temp[2] = (((*this)[1][0] - (*this)[0][1]) * s);
505 uint01 i = (*this)[0][0] < (*this)[1][1] ?
506 ((*this)[1][1] < (*this)[2][2] ? 2U : 1U) :
507 ((*this)[0][0] < (*this)[2][2] ? 2U : 0U);
511 t_type s = t_type((*
this)[i][i] - (*
this)[j][j] - (*
this)[k][k] + t_type(1.0));
512 temp[i] = s * t_type(0.5);
515 temp[3] = ((*this)[k][j] - (*this)[j][k]) * s;
516 temp[j] = ((*this)[j][i] + (*this)[i][j]) * s;
517 temp[k] = ((*this)[k][i] + (*this)[i][k]) * s;
521 template<
class t_angle_type>
524 static_assert(t_col_dims >= 4 && t_row_dims >= 4,
"Cannot decompose lower dimension matrix");
526 position[
X] = (*this)[3][0];
527 position[
Y] = (*this)[3][1];
528 position[
Z] = (*this)[3][2];
531 for (
uint01 i = 0; i < 3; i++)
538 if (
dot(temp_z, rows[2]) < 0)
540 scaling[
X] = -scaling[
X];
543 for (
uint04 i = 0; i < 3; i++)
547 t_type sy =
sqrt(rows[0][0] * rows[0][0] + rows[0][1] * rows[0][1]);
564 mat[t_row_dims - 1][0] = translation[
X];
565 if constexpr (t_col_dims >= 2)
566 mat[t_row_dims - 1][1] = translation[
Y];
567 if constexpr (t_col_dims >= 3)
568 mat[t_row_dims - 1][2] = 0;
569 return (*
this) * mat;
598 for (
uint01 i = 0; i <
getMin(t_row_dims, t_col_dims); i++)
600 if (
abs((*
this)[i][i]) < epsilon)
601 (*this)[i][i] = new_value;
608 mat[0][0] += (
scale - 1) * direction[
X] * direction[
X];
609 mat[0][1] += (
scale - 1) * direction[
Y] * direction[
X];
610 mat[0][2] += (
scale - 1) * direction[
Z] * direction[
X];
612 mat[1][0] += (
scale - 1) * direction[
X] * direction[
Y];
613 mat[1][1] += (
scale - 1) * direction[
Y] * direction[
Y];
614 mat[1][2] += (
scale - 1) * direction[
Z] * direction[
Y];
616 mat[2][0] += (
scale - 1) * direction[
X] * direction[
Z];
617 mat[2][1] += (
scale - 1) * direction[
Y] * direction[
Z];
618 mat[2][2] += (
scale - 1) * direction[
Z] * direction[
Z];
620 return (*
this) * mat;
622 template<
class t_angle_type>
627 template<
class t_angle_type>
637 return (*
this) * mat;
642 for (
uint01 row = 0; row < t_row_dims; row++)
643 for (
uint01 col = 0; col < t_col_dims; col++)
644 mat[col][row] = (*
this)[row][col];
648 template<u
int01 t_cols = t_col_dims, u
int01 t_rows = t_row_dims>
654 [[nodiscard]]
inline t_type*
begin()
656 return &(*this)[0][0];
659 [[nodiscard]]
inline const t_type*
begin()
const
661 return &(*this)[0][0];
668 for(
uint01 col = 0; col < t_col_dims; ++col)
670 for(
uint01 row = 0; row < t_row_dims; ++row)
672 for(
uint01 i = 0; i < t_row_dims; ++i)
674 product[row][col] += ((*this)[i][col] * right[row][i]);
682 for(
uint01 col = 0; col < t_col_dims; ++col)
684 for(
uint01 row = 0; row < t_row_dims; ++row)
686 (*this)[row][col] = right[row][col];
693 *
this = *
this * right;
707 template<
class t_type, u
int01 t_row_dims, u
int01 t_col_dims>
734 template<
class t_type, u
int01 t_row_dims, u
int01 t_col_dims>
737 for (
uint01 dim_a = 0; dim_a < t_col_dims; ++dim_a)
739 for (
uint01 dim_b = 0; dim_b < t_row_dims; ++dim_b)
741 if (
isNaN(value[dim_b][dim_a]))
#define lib_assert(expression, message)
Asserts some logic in the code. Disabled in non debug mode by default. Can be re-enabled in release u...
Definition LibAssert.h:70
Stores an angle in an optimized format.
Definition StringStream.h:352
static Angle atan2(fltp04 value_a, fltp04 value_b)
Definition Angle.h:481
Definition Matrix.hpp:173
Matrix operator*(const Matrix &right) const
Definition Matrix.hpp:665
constexpr Vector< 4, t_type > decomposeRotationQuaternion() const
Definition Matrix.hpp:488
constexpr Matrix(const t_type n00, const t_type n10, const t_type n20, const t_type n01, const t_type n11, const t_type n21, const t_type n02, const t_type n12, const t_type n22)
Definition Matrix.hpp:196
static constexpr Matrix< t_type > RotationMatrix(const Angle< t_angle_type > &phi, const Vector< 3, t_type > &axis)
Definition Matrix.hpp:373
constexpr Matrix< t_type, t_i1 - t_i0+1, t_j1 - t_j0+1 > subMatrix() const
Definition Matrix.hpp:258
const t_type * begin() const
Definition Matrix.hpp:659
constexpr Matrix shear(t_type dx, t_type dy) const
Definition Matrix.hpp:632
constexpr Matrix(const Vector< t_row_dims *t_col_dims, t_type > &vector)
Definition Matrix.hpp:235
constexpr Matrix offset(const Vector< 2, t_type > &translation) const
Definition Matrix.hpp:561
constexpr void decompose(Vector< 3, t_type > &scaling, Vector< 3, Angle< t_angle_type > > &rotation, Vector< 3, t_type > &position) const
Definition Matrix.hpp:522
constexpr Matrix scale(t_type scale) const
Definition Matrix.hpp:579
constexpr Matrix< t_type > rotate(const Angle< t_angle_type > &phi, const Vector< 3, t_type > &axis) const
Definition Matrix.hpp:628
constexpr Matrix(const t_type n00, const t_type n10, const t_type n20, const t_type n30, const t_type n01, const t_type n11, const t_type n21, const t_type n31, const t_type n02, const t_type n12, const t_type n22, const t_type n32, const t_type n03, const t_type n13, const t_type n23, const t_type n33)
Definition Matrix.hpp:207
constexpr Matrix()
Definition Matrix.hpp:175
constexpr Matrix(const t_type diagonal)
Definition Matrix.hpp:178
constexpr Matrix scale(const Vector< 3, t_type > &direction, t_type scale) const
Definition Matrix.hpp:605
static constexpr Matrix< t_type > OffsetMatrix(const Vector< 3, t_type > &translation)
Definition Matrix.hpp:294
Matrix & operator=(const Matrix &right)
Definition Matrix.hpp:680
constexpr Matrix< t_type, t_col_dims, t_row_dims > transpose() const
Definition Matrix.hpp:639
Matrix< t_type, t_cols, t_rows > invert() const
Definition Matrix.hpp:649
constexpr t_type determinant() const
Definition Matrix.hpp:386
constexpr Matrix< t_new_type > as() const
Definition Matrix.hpp:245
constexpr Vector< 3, t_type > decomposeOffset() const
Definition Matrix.hpp:440
static constexpr Matrix< t_type > ScalerMatrix(const Vector< 2, t_type > &scale)
Definition Matrix.hpp:314
constexpr Matrix(const Vector< t_row_dims - 1, t_type > &offset, const Vector< 3, Angle< t_angle_type > > &orientation, const Vector< t_row_dims - 1, t_type > &scale)
Definition Matrix.hpp:221
static constexpr Matrix< t_type > RotationMatrix(const Vector< 3, Angle< t_angle_type > > &orientation)
Definition Matrix.hpp:333
constexpr Matrix rotate(const Vector< 3, Angle< t_angle_type > > &orientation) const
Definition Matrix.hpp:623
static constexpr Matrix< t_type > ScalerMatrix(t_type scale)
Definition Matrix.hpp:304
t_type * begin()
Definition Matrix.hpp:654
constexpr Matrix scale(const Vector< 3, t_type > &scale) const
Definition Matrix.hpp:591
constexpr Matrix offset(const Vector< 3, t_type > &translation) const
Definition Matrix.hpp:574
constexpr Matrix< t_type, t_i_size, t_j1 - t_j0+1 > subMatrix(const Vector< t_i_size, uint01 > &r) const
Definition Matrix.hpp:269
constexpr Matrix(const Matrix &mat)=default
static constexpr Matrix< t_type > ScalerMatrix(const Vector< 3, t_type > &scale)
Definition Matrix.hpp:322
constexpr Matrix(const Vector< t_row_dims, Vector< t_col_dims, t_type > > &vector)
Definition Matrix.hpp:239
constexpr Matrix< t_new_type, t_new_row_dims, t_new_col_dims > as() const
Definition Matrix.hpp:282
Matrix & operator*=(const Matrix &right)
Definition Matrix.hpp:691
constexpr Vector< 3, Angle< t_angle_type > > decomposeRotation() const
Definition Matrix.hpp:454
void correctZeroScale(t_type new_value=1e-6, t_type epsilon=1e-9)
Definition Matrix.hpp:596
constexpr Matrix scale(const Vector< 2, t_type > &scale) const
Definition Matrix.hpp:585
constexpr Vector< 3, t_type > decomposeScale() const
Definition Matrix.hpp:421
constexpr Matrix(const t_type n00, const t_type n10, const t_type n01, const t_type n11)
Definition Matrix.hpp:187
static Vector< 1, Vector< 1, t_type > > invert(Vector< 1, Vector< 1, t_type > > &value)
Definition Matrix.hpp:46
static constexpr t_type determinant(const Vector< 2, Vector< 2, t_type > > &value)
Definition Matrix.hpp:57
static Vector< 2, Vector< 2, t_type > > invert(const Vector< 2, Vector< 2, t_type > > &value)
Definition Matrix.hpp:62
static Vector< 3, Vector< 3, t_type > > invert(const Vector< 3, Vector< 3, t_type > > &value)
Definition Matrix.hpp:85
static constexpr t_type determinant(const Vector< 3, Vector< 3, t_type > > &value)
Definition Matrix.hpp:78
static Vector< 4, Vector< 4, t_type > > invert(const Vector< 4, Vector< 4, t_type > > &value)
Definition Matrix.hpp:107
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
constexpr t_magnitude_type magnitude() const
Definition Vector.hpp:482
constexpr t_type sum() const
Definition Vector.hpp:545
constexpr t_type product() const
Definition Vector.hpp:526
constexpr Vector< t_dims, t_norm_type > normalized(Vector< t_dims, t_norm_type > value_if_nan=Constant< Vector< t_dims, t_norm_type > >::NaN) const
Definition Vector.hpp:500
t_type dot(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition VectorFunctions.hpp:1096
@ ROLL
Definition Angle.h:51
@ YAW
Definition Angle.h:53
@ PITCH
Definition Angle.h:52
constexpr Vector< t_dims, Angle< t_angle_type > > quantize(const Vector< t_dims, Angle< t_angle_type > > &value, Angle< t_angle_type > d=Angle< t_angle_type >(DEGREES, 1.0))
Definition AngleFunctions.h:955
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:98
@ RADIANS
Definition Angle.h:65
std::enable_if<!ObjectInfo< t_type >::Float, fltp08 >::type cos(const Angle< t_type > &angle)
Definition AngleFunctions.h:154
constexpr Vector< 1, t_type > cross(const Vector< 1, t_type > &, const Vector< 1, t_type > &)
Definition VectorFunctions.hpp:954
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
t_type sqrt(const t_type &value)
Definition VectorFunctions.hpp:1309
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr Angle< t_angle_type > abs(const Angle< t_angle_type > &value)
Definition AngleFunctions.h:750
std::enable_if<!ObjectInfo< t_type >::Float, fltp08 >::type sin(const Angle< t_type > &angle)
Definition AngleFunctions.h:113
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ Z
Definition BaseValues.hpp:204
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator.
Definition BaseFunctions.hpp:67
Definition BaseValues.hpp:272
static const t_type Min
Definition BaseValues.hpp:276
static const t_type Max
Definition BaseValues.hpp:278
static const t_type NaN
Definition BaseValues.hpp:274