quat_to_axis_angle.h 760 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef IGL_QUAT_TO_AXIS_ANGLE_H
  2. #define IGL_QUAT_TO_AXIS_ANGLE_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Convert quat representation of a rotation to axis angle
  7. // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),
  8. // such that q = x*i + y*j + z*k + w
  9. // Inputs:
  10. // q quaternion
  11. // Outputs:
  12. // axis 3d vector
  13. // angle scalar in radians
  14. template <typename Q_type>
  15. IGL_INLINE void quat_to_axis_angle(
  16. const Q_type *q,
  17. Q_type *axis,
  18. Q_type & angle);
  19. // Wrapper with angle in degrees
  20. template <typename Q_type>
  21. IGL_INLINE void quat_to_axis_angle_deg(
  22. const Q_type *q,
  23. Q_type *axis,
  24. Q_type & angle);
  25. }
  26. #ifdef IGL_HEADER_ONLY
  27. # include "quat_to_axis_angle.cpp"
  28. #endif
  29. #endif