axis_angle_to_quat.h 627 B

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