|
@@ -12,25 +12,18 @@
|
|
|
|
|
|
namespace igl
|
|
|
{
|
|
|
- // Computes the polar decomposition (R,T) of a matrix A using SVD singular value decomposition
|
|
|
+ // Computes the polar decomposition (R,T) of a matrix A using SVD singular
|
|
|
+ // value decomposition
|
|
|
+ //
|
|
|
// Inputs:
|
|
|
// A 3 by 3 matrix to be decomposed
|
|
|
// Outputs:
|
|
|
- // R 3 by 3 rotation matrix part of decomposition
|
|
|
+ // R 3 by 3 rotation matrix part of decomposition (**always rotataion**)
|
|
|
// T 3 by 3 stretch matrix part of decomposition
|
|
|
// U 3 by 3 left-singular vectors
|
|
|
// S 3 by 1 singular values
|
|
|
// V 3 by 3 right-singular vectors
|
|
|
//
|
|
|
- // Example:
|
|
|
- // polar_svd(A,R,T,U,S,V);
|
|
|
- // // Check if R is a reflection
|
|
|
- // if(R.determinant() < ))
|
|
|
- // {
|
|
|
- // // flip last column of U and rebuild to get rotation
|
|
|
- // U.col(U.cols()-1) *= -1.0;
|
|
|
- // R = U * V.transpose();
|
|
|
- // }
|
|
|
//
|
|
|
template <
|
|
|
typename DerivedA,
|