TooN::SO3< Precision > Class Template Reference
[Transformation matrices]

Class to represent a three-dimensional rotation matrix. More...

#include <so3.h>

List of all members.

Public Member Functions

 SO3 ()
template<int S, typename P, typename A>
 SO3 (const Vector< S, P, A > &v)
template<int R, int C, typename P, typename A>
 SO3 (const Matrix< R, C, P, A > &rhs)
template<int S1, int S2, typename P1, typename P2, typename A1, typename A2>
 SO3 (const Vector< S1, P1, A1 > &a, const Vector< S2, P2, A2 > &b)
template<int R, int C, typename P, typename A>
SO3operator= (const Matrix< R, C, P, A > &rhs)
void coerce ()
Vector< 3, Precision > ln () const
SO3 inverse () const
SO3operator *= (const SO3 &rhs)
SO3 operator * (const SO3 &rhs) const
const Matrix< 3,
3, Precision > & 
get_matrix () const
template<int S, typename A>
Vector< 3, Precision > adjoint (Vector< 3, Precision, A > vect) const

Static Public Member Functions

template<int S, typename A>
static SO3 exp (const Vector< S, Precision, A > &vect)
static Matrix< 3,
3, Precision > 
generator (int i)
template<typename Base>
static Vector< 3,
Precision > 
generator_field (int i, const Vector< 3, Precision, Base > &pos)

Friends

std::istream & o (std::istream &is, SO3< Precision > &rhs)
std::istream & o (std::istream &is, SE3< Precision > &rhs)

Related Functions

(Note that these are not member functions.)

template<typename Precision>
std::ostream & operator<< (std::ostream &os, const SO3< Precision > &rhs)
template<typename Precision>
std::istream & operator>> (std::istream &is, SO3< Precision > &rhs)
template<int S, typename P, typename PV, typename A>
Vector< 3, typename
Internal::MultiplyType
< P, PV >::type > 
operator * (const SO3< P > &lhs, const Vector< S, PV, A > &rhs)
template<int S, typename P, typename PV, typename A>
Vector< 3, typename
Internal::MultiplyType
< PV, P >::type > 
operator * (const Vector< S, PV, A > &lhs, const SO3< P > &rhs)
template<int R, int C, typename P, typename PM, typename A>
Matrix< 3, C,
typename
Internal::MultiplyType
< P, PM >::type > 
operator * (const SO3< P > &lhs, const Matrix< R, C, PM, A > &rhs)
template<int R, int C, typename P, typename PM, typename A>
Matrix< R,
3, typename
Internal::MultiplyType
< PM, P >::type > 
operator * (const Matrix< R, C, PM, A > &lhs, const SO3< P > &rhs)

Classes

struct  Invert


Detailed Description

template<typename Precision = double>
class TooN::SO3< Precision >

Class to represent a three-dimensional rotation matrix.

Three-dimensional rotation matrices are members of the Special Orthogonal Lie group SO3. This group can be parameterised three numbers (a vector in the space of the Lie Algebra). In this class, the three parameters are the finite rotation vector, i.e. a three-dimensional vector whose direction is the axis of rotation and whose length is the angle of rotation in radians. Exponentiating this vector gives the matrix, and the logarithm of the matrix gives this vector.


Constructor & Destructor Documentation

template<typename Precision = double>
TooN::SO3< Precision >::SO3 (  ) 

Default constructor. Initialises the matrix to the identity (no rotation).

template<typename Precision = double>
template<int S1, int S2, typename P1, typename P2, typename A1, typename A2>
TooN::SO3< Precision >::SO3 ( const Vector< S1, P1, A1 > &  a,
const Vector< S2, P2, A2 > &  b 
)

creates an SO3 as a rotation that takes Vector a into the direction of Vector b with the rotation axis along a ^ b.

If |a ^ b| == 0, it creates the identity rotation.

Parameters:
a source Vector
b target Vector


Member Function Documentation

template<typename Precision = double>
template<int R, int C, typename P, typename A>
SO3& TooN::SO3< Precision >::operator= ( const Matrix< R, C, P, A > &  rhs  ) 

Assigment operator from a general matrix.

This also calls coerce() to make sure that the matrix is a valid rotation matrix.

template<typename Precision = double>
void TooN::SO3< Precision >::coerce (  ) 

Modifies the matrix to make sure it is a valid rotation matrix.

template<typename Precision>
template<int S, typename VA>
SO3< Precision > TooN::SO3< Precision >::exp ( const Vector< S, Precision, VA > &  vect  )  [static]

Exponentiate a vector in the Lie algebra to generate a new SO3.

See the Detailed Description for details of this vector.

template<typename Precision>
Vector< 3, Precision > TooN::SO3< Precision >::ln (  )  const

Take the logarithm of the matrix, generating the corresponding vector in the Lie Algebra.

See the Detailed Description for details of this vector.

template<typename Precision = double>
SO3 TooN::SO3< Precision >::inverse (  )  const

Returns the inverse of this matrix (=the transpose, so this is a fast operation).

template<typename Precision = double>
SO3& TooN::SO3< Precision >::operator *= ( const SO3< Precision > &  rhs  ) 

Right-multiply by another rotation matrix.

template<typename Precision = double>
SO3 TooN::SO3< Precision >::operator * ( const SO3< Precision > &  rhs  )  const

Right-multiply by another rotation matrix.

template<typename Precision = double>
const Matrix<3,3, Precision>& TooN::SO3< Precision >::get_matrix (  )  const

Returns the SO3 as a Matrix<3>.

template<typename Precision = double>
static Matrix<3,3, Precision> TooN::SO3< Precision >::generator ( int  i  )  [static]

Returns the i-th generator.

The generators of a Lie group are the basis for the space of the Lie algebra. For SO3, the generators are three $3\times3$ matrices representing the three possible (linearised) rotations.

template<typename Precision = double>
template<typename Base>
static Vector<3,Precision> TooN::SO3< Precision >::generator_field ( int  i,
const Vector< 3, Precision, Base > &  pos 
) [static]

Returns the i-th generator times pos.

template<typename Precision = double>
template<int S, typename A>
Vector<3, Precision> TooN::SO3< Precision >::adjoint ( Vector< 3, Precision, A >  vect  )  const

Transfer a vector in the Lie Algebra from one co-ordinate frame to another such that for a matrix $ M $, the adjoint $Adj()$ obeys $ e^{\text{Adj}(v)} = Me^{v}M^{-1} $.


Friends And Related Function Documentation

template<typename Precision>
std::ostream & operator<< ( std::ostream &  os,
const SO3< Precision > &  rhs 
) [related]

Write an SO3 to a stream.

template<typename Precision>
std::istream & operator>> ( std::istream &  is,
SO3< Precision > &  rhs 
) [related]

Read from SO3 to a stream.

template<int S, typename P, typename PV, typename A>
Vector< 3, typename Internal::MultiplyType< P, PV >::type > operator * ( const SO3< P > &  lhs,
const Vector< S, PV, A > &  rhs 
) [related]

Right-multiply by a Vector.

template<int S, typename P, typename PV, typename A>
Vector< 3, typename Internal::MultiplyType< PV, P >::type > operator * ( const Vector< S, PV, A > &  lhs,
const SO3< P > &  rhs 
) [related]

Left-multiply by a Vector.

template<int R, int C, typename P, typename PM, typename A>
Matrix< 3, C, typename Internal::MultiplyType< P, PM >::type > operator * ( const SO3< P > &  lhs,
const Matrix< R, C, PM, A > &  rhs 
) [related]

Right-multiply by a matrix.

template<int R, int C, typename P, typename PM, typename A>
Matrix< R, 3, typename Internal::MultiplyType< PM, P >::type > operator * ( const Matrix< R, C, PM, A > &  lhs,
const SO3< P > &  rhs 
) [related]

Left-multiply by a matrix.


Generated on Thu May 7 20:28:42 2009 for TooN by  doxygen 1.5.3