polar_svd.h 726 B

1234567891011121314151617181920212223
  1. #ifndef IGL_POLAR_SVD
  2. #define IGL_POLAR_SVD
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. // Computes the polar decomposition (R,T) of a matrix A using SVD singular value decomposition
  8. // Inputs:
  9. // A 3 by 3 matrix to be decomposed
  10. // Outputs:
  11. // R 3 by 3 rotation matrix part of decomposition
  12. // T 3 by 3 stretch matrix part of decomposition
  13. //
  14. IGL_INLINE void polar_svd(const Eigen::Matrix3f& A, Eigen::Matrix3f& R, Eigen::Matrix3f& T);
  15. IGL_INLINE void polar_svd(const Eigen::Matrix2f& A, Eigen::Matrix2f& R, Eigen::Matrix2f& T);
  16. template<typename Mat>
  17. IGL_INLINE void polar_svd(const Mat& A, Mat& R, Mat& T);
  18. }
  19. #ifdef IGL_HEADER_ONLY
  20. # include "polar_svd.cpp"
  21. #endif
  22. #endif