quat_conjugate.h 642 B

12345678910111213141516171819202122232425
  1. #ifndef IGL_QUAT_CONJUGATE_H
  2. #define IGL_QUAT_CONJUGATE_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Compute conjugate of given quaternion
  7. // http://en.wikipedia.org/wiki/Quaternion#Conjugation.2C_the_norm.2C_and_reciprocal
  8. // A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),
  9. // such that q = x*i + y*j + z*k + w
  10. // Inputs:
  11. // q1 input quaternion
  12. // Outputs:
  13. // out result of conjugation, allowed to be same as input
  14. template <typename Q_type>
  15. IGL_INLINE void quat_conjugate(
  16. const Q_type *q1,
  17. Q_type *out);
  18. };
  19. #ifdef IGL_HEADER_ONLY
  20. # include "quat_conjugate.cpp"
  21. #endif
  22. #endif