|
MiniTensor Version of the Day
|
Logarithmic and exponential maps on SO(N), quaternions, and conversions among rotation representations: rotation matrix, unit quaternion and principal rotation vector. More...
Classes | |
| class | minitensor::Quaternion< T > |
Logarithmic and exponential maps on SO(N), quaternions, and conversions among rotation representations: rotation matrix, unit quaternion and principal rotation vector.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::operator* | ( | Quaternion< T > const & | p, |
| Quaternion< T > const & | q | ||
| ) |
Hamilton product of two quaternions
| p | quaternion |
| q | quaternion |
Definition at line 393 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION bool minitensor::operator== | ( | Quaternion< T > const & | p, |
| Quaternion< T > const & | q | ||
| ) |
Quaternion equality, tested component-wise.
| p | quaternion |
| q | quaternion |
Definition at line 411 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION bool minitensor::operator!= | ( | Quaternion< T > const & | p, |
| Quaternion< T > const & | q | ||
| ) |
Quaternion inequality, tested component-wise.
| p | quaternion |
| q | quaternion |
Definition at line 422 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::conjugate | ( | Quaternion< T > const & | q | ) |
Quaternion conjugate
| q | quaternion |
Definition at line 433 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION T minitensor::norm | ( | Quaternion< T > const & | q | ) |
Quaternion norm
| q | quaternion |
Definition at line 444 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::inverse | ( | Quaternion< T > const & | q | ) |
Quaternion inverse
| q | quaternion |
Definition at line 456 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::unit | ( | Quaternion< T > const & | q | ) |
Quaternion normalized to unit norm
| q | quaternion |
Definition at line 470 of file MiniTensor_Quaternion.h.
| std::ostream & minitensor::operator<< | ( | std::ostream & | os, |
| Quaternion< T > const & | q | ||
| ) |
Quaternion output, scalar-first components separated by commas.
| os | output stream |
| q | quaternion |
Definition at line 482 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::q_of_rt | ( | Tensor< T, N > const & | R | ) |
Quaternion of a rotation matrix, using Spurrier's singularity-free algorithm. Selects the largest of the trace and the diagonal entries of the matrix and computes the quaternion components accordingly, which ensures a stable evaluation for all rotation angles including \( \theta = \pi \).
| R | rotation matrix with \( R \in SO(3) \) |
Definition at line 502 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Vector< T, 3 > minitensor::rv_of_q | ( | Quaternion< T > const & | q | ) |
Principal rotation vector of a quaternion. The sign of the quaternion is first normalized so that \( q_s \geq 0 \), which selects the principal rotation \( |rv| \leq \pi \). Small rotations use an alternate evaluation to avoid numerical instability.
| q | unit quaternion |
Definition at line 616 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Quaternion< T > minitensor::q_of_rv | ( | Vector< T, N > const & | rv | ) |
Quaternion of a rotation vector, computed as \( q_s = \cos(|rv|/2) \), \( q_v = \frac{1}{2}\,\psi(|rv|/2)\, rv \) with \( \psi(x) = \sin(x)/x \), using asymptotic expansions of \( \psi \) for small angles.
| rv | rotation vector |
Definition at line 663 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, 3 > minitensor::rt_of_q | ( | Quaternion< T > const & | q | ) |
Rotation matrix of a quaternion, based on the identity \( R = 2 q_v \otimes q_v + 2 q_s \mathrm{skew}(q_v) + (2 q_s^2 - 1) I \).
| q | unit quaternion |
Definition at line 686 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Vector< T, 3 > minitensor::rv_of_rt | ( | Tensor< T, N > const & | R | ) |
Principal rotation vector of a rotation matrix, computed through the quaternion representation as rv_of_q(q_of_rt(R)). Unlike log_rotation, this path is singularity-free for all rotation angles including \( \theta = \pi \).
| R | rotation matrix with \( R \in SO(3) \) |
Definition at line 707 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, 3 > minitensor::rt_of_rv | ( | Vector< T, N > const & | rv | ) |
Rotation matrix of a rotation vector, computed through the quaternion representation as rt_of_q(q_of_rv(rv)).
| rv | rotation vector |
Definition at line 718 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Vector< T, N > minitensor::rv_continue | ( | Vector< T, N > const & | old, |
| Vector< T, N > const & | prev | ||
| ) |
Rotation vector equivalent to old (representing the same rotation) but as close as possible to prev. Resolves the \( 2 \pi k \) ambiguity of the rotation-vector representation, which enforces continuity in incremental rotation updates such as time stepping.
| old | rotation vector to continue |
| prev | previous rotation vector |
Definition at line 729 of file MiniTensor_Quaternion.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::log_rotation | ( | Tensor< T, N > const & | R | ) |
Logarithmic map of a rotation
| R | with \( R \in SO(3) \) |
Definition at line 71 of file MiniTensor_Rotations.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::log_rotation_pi | ( | Tensor< T, N > const & | R | ) |
Logarithmic map of a 180 degree rotation
| R | with \( R \in SO(3) \) |
Definition at line 141 of file MiniTensor_Rotations.h.
| KOKKOS_INLINE_FUNCTION Tensor< T, N > minitensor::exp_skew_symmetric | ( | Tensor< T, N > const & | r | ) |
Exponential map of a skew-symmetric tensor
| r | \( r \in so(3) \) |
Definition at line 229 of file MiniTensor_Rotations.h.
| KOKKOS_INLINE_FUNCTION Vector< T, N > minitensor::vee | ( | Tensor< T, N > const & | W | ) |
Axial vector of a skew-symmetric tensor, the inverse of skew(Vector). Defined for 3D only.
| W | skew-symmetric tensor \( W \in so(3) \) |
Definition at line 292 of file MiniTensor_Rotations.h.