|
adamantine
|
#include <Quaternion.hh>
Public Member Functions | |
| Quaternion () | |
| Quaternion (double const r, double const i, double const j, double const k) | |
| void | reinit (double const r, double const i, double const j, double const k) |
| bool | is_valid () const |
| dealii::Point< 3, double > | rotate (dealii::Point< 3, double > const &point) const |
| dealii::Point< 3, dealii::VectorizedArray< double > > | rotate (dealii::Point< 3, dealii::VectorizedArray< double >> const &points) const |
| dealii::Point< 3, double > | inv_rotate (dealii::Point< 3, double > const &point) const |
| dealii::Point< 3, dealii::VectorizedArray< double > > | inv_rotate (dealii::Point< 3, dealii::VectorizedArray< double >> const &points) const |
| bool | operator== (Quaternion const &other) const |
| Quaternion & | operator*= (Quaternion const &other) |
| Quaternion & | operator/= (Quaternion const &other) |
| void | pow (double const exp) |
Private Member Functions | |
| void | build_rotation_matrices () |
Private Attributes | |
| bool | _is_valid = false |
| std::array< double, 4 > | _quaternion |
| dealii::Tensor< 2, 3, double > | _rotation_matrix |
| dealii::Tensor< 2, 3, double > | _inv_rotation_matrix |
| dealii::Tensor< 2, 3, dealii::VectorizedArray< double > > | _vec_rotation_matrix |
| dealii::Tensor< 2, 3, dealii::VectorizedArray< double > > | _vec_inv_rotation_matrix |
This class defines rotation using quaternion. Unit quaternions, known as versors, provide a convenient mathematical notation for representing spatial orientations and rotations of elements in three dimensional space. Specifically, they encode information about an axis-angle rotation about an arbitrary axis.
Definition at line 21 of file Quaternion.hh.
| adamantine::Quaternion::Quaternion | ( | ) |
Default constructor. The object is initialized in an invalid state. It can only be used after calling reinit().
Definition at line 14 of file Quaternion.cc.
| adamantine::Quaternion::Quaternion | ( | double const | r, |
| double const | i, | ||
| double const | j, | ||
| double const | k | ||
| ) |
Constructor. The quaternion should be normed.
Definition at line 30 of file Quaternion.cc.
|
private |
Build the different rotation matrices.
Definition at line 116 of file Quaternion.cc.
|
inline |
Rotate the given points by the inverse of the quaternion.
Definition at line 144 of file Quaternion.hh.
|
inline |
Rotate the given point by the inverse of the quaternion.
Definition at line 139 of file Quaternion.hh.
| bool adamantine::Quaternion::is_valid | ( | ) | const |
Return true if the quaternion has been initialized.
Definition at line 50 of file Quaternion.cc.
| Quaternion & adamantine::Quaternion::operator*= | ( | Quaternion const & | other | ) |
Multiply two quaternions together using the Hamilton product. The resulting quaternion describes the single combined rotation that results from applying the two rotations.
Definition at line 60 of file Quaternion.cc.
| Quaternion & adamantine::Quaternion::operator/= | ( | Quaternion const & | other | ) |
Multiply the quaternions using the inverse of other.
Definition at line 84 of file Quaternion.cc.
| bool adamantine::Quaternion::operator== | ( | Quaternion const & | other | ) | const |
Test for equality of two quaternions.
Definition at line 52 of file Quaternion.cc.
| void adamantine::Quaternion::pow | ( | double const | exp | ) |
Compute the power to the exp of the quaternion. If exp is less than one, this corresponds to a partial rotation.
Definition at line 96 of file Quaternion.cc.
| void adamantine::Quaternion::reinit | ( | double const | r, |
| double const | i, | ||
| double const | j, | ||
| double const | k | ||
| ) |
Reinitialize the quaternion. The norm should be equal to one.
Definition at line 36 of file Quaternion.cc.
|
inline |
Rotate the given points.
Definition at line 131 of file Quaternion.hh.
|
inline |
Rotate the given point.
Definition at line 126 of file Quaternion.hh.
|
private |
Rotation matrix defined by the inverse quaternion.
Definition at line 113 of file Quaternion.hh.
|
private |
Flag is false if the default constructor was called and reinit() has not been called yet.
Definition at line 101 of file Quaternion.hh.
|
private |
Store the value of the quaternion.
Definition at line 105 of file Quaternion.hh.
|
private |
Rotation matrix defined by the quaternion.
Definition at line 109 of file Quaternion.hh.
|
private |
Vectorized rotation matrix defined by the inverse quaternion.
Definition at line 122 of file Quaternion.hh.
|
private |
Vectorized rotation matrix defined by the quaternion.
Definition at line 117 of file Quaternion.hh.