#include <MRQuaternion.h>
|
static Quaternion | lerp (const Quaternion &q0, const Quaternion &q1, T t) |
| given t in [0,1], interpolates linearly two quaternions giving in general not-unit quaternion
|
|
static Quaternion | slerp (Quaternion q0, Quaternion q1, T t) |
| given t in [0,1] and two unit quaternions, interpolates them spherically and produces another unit quaternion
|
|
static Matrix3< T > | slerp (const Matrix3< T > &m0, const Matrix3< T > &m1, T t) |
| given t in [0,1] and two rotation matrices, interpolates them spherically and produces another rotation matrix
|
|
static AffineXf3< T > | slerp (const AffineXf3< T > &xf0, const AffineXf3< T > &xf1, T t, const Vector3< T > &p={}) |
|
|
T | a = 1 |
| real part of the quaternion
|
|
T | b = 0 |
|
T | c = 0 |
|
T | d = 0 |
| imaginary part: b*i + c*j + d*k
|
|
|
(Note that these are not member symbols.)
|
|
template<typename T > |
T | dot (const Quaternion< T > &a, const Quaternion< T > &b) |
| dot product
|
|
template<typename T > |
Quaternion< T > | operator* (const Quaternion< T > &q1, const Quaternion< T > &q2) |
| Hamilton product.
|
|
template<typename T > |
Quaternion< T > | getClosestCanonicalQuaternion (const Quaternion< T > &base) noexcept |
| returns closest to base canonical quaternion
|
|
template<typename T > |
Matrix3< T > | slerp (const Matrix3< T > &m0, const Matrix3< T > &m1, T t) |
| given t in [0,1] and two rotation matrices, interpolates them spherically and produces another rotation matrix
|
|
template<typename T > |
AffineXf3< T > | slerp (const AffineXf3< T > &xf0, const AffineXf3< T > &xf1, T t, const Vector3< T > &p={}) |
|
template<typename T > |
Matrix3< T > | orthonormalized (const Matrix3< T > &m) |
| given any matrix, returns a close rotation matrix
|
|
template<typename T > |
AffineXf3< T > | orthonormalized (const AffineXf3< T > &xf, const Vector3< T > ¢er={}) |
|
template<typename T>
struct MR::Quaternion< T >
Represents a quaternion following the notations from https://en.wikipedia.org/wiki/Quaternion
◆ Quaternion() [1/6]
◆ Quaternion() [2/6]
◆ Quaternion() [3/6]
◆ Quaternion() [4/6]
◆ Quaternion() [5/6]
◆ Quaternion() [6/6]
finds shorter arc rotation quaternion from one vector to another
◆ angle()
template<typename T >
|
inlinenodiscardconstexprnoexcept |
returns angle of rotation encoded in this quaternion
◆ axis()
template<typename T >
|
inlinenodiscardconstexprnoexcept |
returns axis of rotation encoded in this quaternion
◆ conjugate()
template<typename T >
|
inlinenodiscardconstexprnoexcept |
computes conjugate quaternion, which for unit quaternions encodes the opposite rotation
◆ im()
template<typename T >
|
inlinenodiscardconstexprnoexcept |
returns imaginary part of the quaternion as a vector
◆ inverse()
template<typename T >
|
inlinenodiscardconstexprnoexcept |
computes reciprocal quaternion
◆ lerp()
given t in [0,1], interpolates linearly two quaternions giving in general not-unit quaternion
◆ norm()
◆ normalize()
scales this quaternion to make its norm unit
◆ normalized()
◆ normSq()
◆ operator Matrix3< T >()
converts this into 3x3 rotation matrix
◆ operator()()
template<typename T >
|
nodiscardconstexprnoexcept |
for unit quaternion returns the rotation of point p, which is faster to compute for single point; for multiple points it is faster to create matrix representation and apply it to the points
◆ operator*=()
◆ operator-()
returns quaternion representing the same rotation, using the opposite rotation direction and opposite angle
◆ operator/=()
◆ slerp() [1/3]
given t in [0,1] and rigid transformations, interpolates them spherically and produces another rigid transformation; p is the only point that will have straight line movement during interpolation
◆ slerp() [2/3]
given t in [0,1] and two rotation matrices, interpolates them spherically and produces another rotation matrix
◆ slerp() [3/3]
given t in [0,1] and two unit quaternions, interpolates them spherically and produces another unit quaternion
◆ dot()
◆ getClosestCanonicalQuaternion()
returns closest to base canonical quaternion
◆ operator*()
◆ orthonormalized() [1/2]
given any affine transformation, returns a close rigid transformation; center point will be transformed to same point by both input and output transformations
◆ orthonormalized() [2/2]
given any matrix, returns a close rotation matrix
◆ slerp() [1/2]
given t in [0,1] and rigid transformations, interpolates them spherically and produces another rigid transformation; p is the only point that will have straight line movement during interpolation
◆ slerp() [2/2]
given t in [0,1] and two rotation matrices, interpolates them spherically and produces another rotation matrix
real part of the quaternion
imaginary part: b*i + c*j + d*k
The documentation for this struct was generated from the following file: