|
MiniTensor Version of the Day
|
#include <MiniTensor_Quaternion.h>
Public Member Functions | |
| KOKKOS_INLINE_FUNCTION | Quaternion () |
| KOKKOS_INLINE_FUNCTION | Quaternion (T const &s, Vector< T, 3 > const &v) |
| KOKKOS_INLINE_FUNCTION | Quaternion (T const &s, T const &v0, T const &v1, T const &v2) |
| KOKKOS_INLINE_FUNCTION | Quaternion (Vector< T, 4 > const &q) |
| KOKKOS_INLINE_FUNCTION T const & | scalar () const |
| KOKKOS_INLINE_FUNCTION T & | scalar () |
| KOKKOS_INLINE_FUNCTION Vector< T, 3 > const & | vector () const |
| KOKKOS_INLINE_FUNCTION Vector< T, 3 > & | vector () |
| KOKKOS_INLINE_FUNCTION T const & | operator() (Index const i) const |
| KOKKOS_INLINE_FUNCTION T & | operator() (Index const i) |
| KOKKOS_INLINE_FUNCTION Vector< T, 4 > | to_vector () const |
Private Attributes | |
| T | s_ {} |
| Vector< T, 3 > | v_ |
Quaternion class. Scalar-first convention: the quaternion \( q = (q_s; q_v) \) has scalar part \( q_s \) and vector part \( q_v \in R^3 \). A unit quaternion encodes the rotation by angle \( \theta \) about the unit axis \( n \) as \( q_s = \cos(\theta/2) \), \( q_v = \sin(\theta/2)\, n \).
Definition at line 72 of file MiniTensor_Quaternion.h.
|
inline |
Default construction: identity quaternion \( (1; 0, 0, 0) \).
Definition at line 80 of file MiniTensor_Quaternion.h.
|
inline |
Construction from scalar and vector parts.
| s | scalar part |
| v | vector part |
Definition at line 90 of file MiniTensor_Quaternion.h.
|
inline |
Construction from four components, scalar first.
| s | scalar part |
| v0 | first component of the vector part |
| v1 | second component of the vector part |
| v2 | third component of the vector part |
Definition at line 102 of file MiniTensor_Quaternion.h.
|
inlineexplicit |
Construction from a 4-vector in scalar-first order.
| q | 4-vector \( (q_s, q_{v0}, q_{v1}, q_{v2}) \) |
Definition at line 113 of file MiniTensor_Quaternion.h.
|
inline |
Scalar part.
Definition at line 122 of file MiniTensor_Quaternion.h.
|
inline |
Scalar part, mutable.
Definition at line 132 of file MiniTensor_Quaternion.h.
|
inline |
Vector part.
Definition at line 142 of file MiniTensor_Quaternion.h.
|
inline |
Vector part, mutable.
Definition at line 152 of file MiniTensor_Quaternion.h.
|
inline |
Indexed access, scalar first.
| i | component index: 0 is the scalar part, 1..3 the vector part |
Definition at line 163 of file MiniTensor_Quaternion.h.
|
inline |
Indexed access, scalar first, mutable.
| i | component index: 0 is the scalar part, 1..3 the vector part |
Definition at line 175 of file MiniTensor_Quaternion.h.
|
inline |
Components as a 4-vector in scalar-first order.
Definition at line 186 of file MiniTensor_Quaternion.h.
|
private |
Scalar part.
Definition at line 205 of file MiniTensor_Quaternion.h.
Vector part.
Definition at line 211 of file MiniTensor_Quaternion.h.