quat_to_axis_angle.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_QUAT_TO_AXIS_ANGLE_H
  9. #define IGL_QUAT_TO_AXIS_ANGLE_H
  10. #include "igl_inline.h"
  11. namespace igl
  12. {
  13. /// Convert quat representation of a rotation to axis angle
  14. /// A Quaternion, q, is defined here as an arrays of four scalars (x,y,z,w),
  15. /// such that q = x*i + y*j + z*k + w
  16. ///
  17. /// @param[in] q quaternion
  18. /// @param[out] axis 3d vector
  19. /// @param[out] angle scalar in radians
  20. template <typename Q_type>
  21. IGL_INLINE void quat_to_axis_angle(
  22. const Q_type *q,
  23. Q_type *axis,
  24. Q_type & angle);
  25. /// \overload
  26. ///
  27. /// \fileinfo
  28. template <typename Q_type>
  29. IGL_INLINE void quat_to_axis_angle_deg(
  30. const Q_type *q,
  31. Q_type *axis,
  32. Q_type & angle);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "quat_to_axis_angle.cpp"
  36. #endif
  37. #endif