#include <vnl_quaternion.h>
Inheritance diagram for vnl_quaternion:
Public Methods | |
vnl_quaternion () | |
vnl_quaternion (T x, T y, T z, T r) | |
vnl_quaternion (const vnl_vector< T > &axis, T angle) | |
vnl_quaternion (const vnl_matrix< T > &transform) | |
vnl_quaternion (const vnl_vector< T > &vec) | |
vnl_quaternion (const vnl_quaternion< T > &from) | |
~vnl_quaternion () | |
vnl_quaternion & | operator= (const vnl_quaternion< T > &rhs) |
T & | x () |
T & | y () |
T & | z () |
T & | r () |
T | x () const |
T | y () const |
T | z () const |
T | r () const |
T | real () const |
vnl_vector< T > | imaginary () const |
vnl_vector< T > | axis () const |
T | angle () const |
vnl_matrix_fixed< T, 3, 3 > | rotation_matrix () const |
vnl_matrix_fixed< T, 4, 4 > | rotation_matrix_4 () const |
vnl_quaternion< T > | conjugate () const |
vnl_quaternion< T > | inverse () const |
vnl_quaternion< T > | operator * (const vnl_quaternion< T > &) const |
vnl_vector< T > | rotate (const vnl_vector< T > &v) const |
q = r + (i*x + j*y + k*z) r = cos(theta/2) (x, y, z) = sin(theta/2) (kx, ky, kz)
Unit quaternion provides a more efficient representation for rotation, than the usual orthonormal matrix that has nine parameters and six orthonormal constraints. The unit quaternion has only one unit magnitude constraint. Composing rotations with quaternions results in fewer multiplications and less error. To insure valid rotation result, the nearest unit quaternion is computed, and this is much easier than finding the nearest orthonormal matrix. Transforming vectors with a quaternion requires more operations compared to multiplication with the equivalent orthonormal matrix.
See also Vector<Type> and Matrix<Type> for basic operations on vectors and matrices.
Transform for coordinate transformations.
Envelope for envelope-letter scheme that avoids deep copy on return by value in arithmetic expressions like: q1 * q2 * q3 *...
Definition at line 59 of file vnl_quaternion.h.
|
Constructor for null quaternion. Definition at line 65 of file vnl_quaternion.h. |
|
Construct quaternion from components x,y,z,r. |
|
Construct quaternion from axis and angle of rotation. |
|
Construct quaternion from from 3-4 square row-major. |
|
Construct quaternion from from from 3-4D vector. |
|
Copy constructor. Definition at line 151 of file vnl_quaternion.h. References vnl_vector< T >::operator()(). |
|
Free internal array. Definition at line 161 of file vnl_quaternion.h. |
|
Angle of rotation. Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |
|
Axis of rotation. Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |
|
Same real, opposite img part. |
|
Imaginary vector part. Definition at line 235 of file vnl_quaternion.h. |
|
Inverse for nonzero quat. |
|
|
|
q1 = q2. Definition at line 251 of file vnl_quaternion.h. |
|
r. Accessors for the imaginary and real components of the quaternion. Use these accessors to both get and set the components. Definition at line 227 of file vnl_quaternion.h. |
|
Real component. Definition at line 195 of file vnl_quaternion.h. References vnl_vector< T >::operator()(). Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |
|
Copies and returns the real part. Definition at line 242 of file vnl_quaternion.h. |
|
Rotate 3D v. |
|
3x3 rotation matrix. |
|
4x4 rotation matrix. |
|
x. Reimplemented from vnl_vector< T >. Definition at line 203 of file vnl_quaternion.h. References vnl_vector< T >::extract(). |
|
x. Definition at line 168 of file vnl_quaternion.h. References vnl_vector< T >::operator()(). Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |
|
y. Reimplemented from vnl_vector< T >. Definition at line 210 of file vnl_quaternion.h. References vnl_vector< T >::get(). |
|
y. Definition at line 176 of file vnl_quaternion.h. References vnl_vector< T >::operator()(). Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |
|
z. Reimplemented from vnl_vector< T >. Definition at line 217 of file vnl_quaternion.h. |
|
Imaginary components, parallel to axis of rotation. Definition at line 184 of file vnl_quaternion.h. Referenced by vnl_quaternion< TScalarType >::vnl_quaternion(). |