Functions

OpenTissue::math::polar_decomposition Namespace Reference

Functions

template<typename matrix3x3_type >
bool eigen (matrix3x3_type const &A, matrix3x3_type &R, matrix3x3_type &S)
template<typename matrix3x3_type >
bool newton (matrix3x3_type const &A, matrix3x3_type &R, unsigned int max_iterations, typename matrix3x3_type::value_type const &threshold)

Function Documentation

template<typename matrix3x3_type >
bool OpenTissue::math::polar_decomposition::eigen ( matrix3x3_type const &  A,
matrix3x3_type &  R,
matrix3x3_type &  S 
) [inline]
template<typename matrix3x3_type >
bool OpenTissue::math::polar_decomposition::newton ( matrix3x3_type const &  A,
matrix3x3_type &  R,
unsigned int  max_iterations,
typename matrix3x3_type::value_type const &  threshold 
) [inline]

This method is rather bad, it is iterative and there is no way of telling how good the solution is. thus we recommend the eigen method for polar decomposition.

Polar Decomposition as described by Shoemake and Duff in ``Matrix Animation and Polar Decomposition''

A = R S

Where R is a special orthogonal matrix (R*R^T = I and det(R)=1)

Set R_0 = A Do R_{i+1} = 1/2( R_i + R^{-T}_i ) Until R_{i+1}-R_i = 0

Returns:
If a solution was found within the specified threshold value then the return value is true otherwise it is false.