polar_dec.h 583 B

123456789101112131415161718192021222324
  1. #ifndef IGL_POLAR_DEC
  2. #define IGL_POLAR_DEC
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Computes the polar decomposition (R,T) of a matrix A
  7. // Inputs:
  8. // A 3 by 3 matrix to be decomposed
  9. // Outputs:
  10. // R 3 by 3 rotation matrix part of decomposition
  11. // T 3 by 3 stretch matrix part of decomposition
  12. //
  13. // Note: I'm not sure if this implementation is check against reflections in R
  14. // Note: It is not
  15. //
  16. template<typename Mat>
  17. IGL_INLINE void polar_dec(const Mat& A, Mat& R, Mat& T);
  18. }
  19. #ifdef IGL_HEADER_ONLY
  20. # include "polar_dec.cpp"
  21. #endif
  22. #endif