axis_angle_to_quat.h 593 B

1234567891011121314151617181920212223242526
  1. #ifndef IGL_AXIS_ANGLE_TO_QUAT_H
  2. #define IGL_AXIS_ANGLE_TO_QUAT_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Convert axis angle representation of a rotation to a quaternion
  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. // axis 3d vector
  11. // angle scalar
  12. // Outputs:
  13. // quaternion
  14. template <typename Q_type>
  15. IGL_INLINE void axis_angle_to_quat(
  16. const Q_type *axis,
  17. const Q_type angle,
  18. Q_type *out);
  19. }
  20. #ifdef IGL_HEADER_ONLY
  21. # include "axis_angle_to_quat.cpp"
  22. #endif
  23. #endif