Quaternion
==========

.. lua:module:: Imath

Imath.Quatf
^^^^^^^^^^^

.. lua:class:: Quatf

   .. lua:attribute:: float r
   .. lua:attribute:: V3f v

   .. lua:method:: Quatf() -> Quatf
   .. lua:method:: Quatf(Quatf) -> Quatf
   .. lua:method:: Quatf(Quatd) -> Quatf
   .. lua:method:: Quatf(float s, float i, float j, float k) -> Quatf
   .. lua:method:: Quatf(float s, V3f d) -> Quatf
   .. lua:method:: Quatf(float s, table[3] t) -> Quatf
   .. lua:method:: Quatf(table[4] t) -> Quatf

   .. lua:method:: operator==(Quatf q) const -> boolean
   .. lua:method:: operator!=(Quatf q) const -> boolean
   .. lua:method:: operator[](int idx) const -> float
   .. lua:method:: operator[](int idx, float value)
   .. lua:method:: operator*(M33f m) const -> M33f
   .. lua:method:: operator*(Quatf q) const -> Quatf
   .. lua:method:: operator*(float s) const -> Quatf
   .. lua:method:: operator/(Quatf q) const -> Quatf
   .. lua:method:: operator/(float s) const -> Quatf
   .. lua:method:: operator+(Quatf q) const -> Quatf
   .. lua:method:: operator-(Quatf q) const -> Quatf
   .. lua:method:: operator-() const -> Quatf
   .. lua:method:: operator^(Quatf q) const -> Quatf
   .. lua:method:: not_() const -> Quatf

   .. lua:method:: invert() -> Quatf&
   .. lua:method:: inverse() const -> Quatf
   .. lua:method:: normalize() -> Quatf&
   .. lua:method:: normalized() const -> Quatf
   .. lua:method:: length() const -> float
   .. lua:method:: rotateVector(V3f original) const -> V3f
   .. lua:method:: euclideanInnerProduct(Quatf q) const -> float

   .. lua:method:: setAxisAngle(V3f axis, float radians) -> Quatf&
   .. lua:method:: setRotation(V3f fromDirection, V3f toDirection) -> Quatf&

   .. lua:method:: angle() const -> float
   .. lua:method:: axis() const -> V3f

   .. lua:method:: toMatrix33() const -> M33f
   .. lua:method:: toMatrix44() const -> M44f

   .. lua:method:: log() const -> Quatf
   .. lua:method:: exp() const -> Quatf

   .. lua:method:: toTable() const -> table[4]

   .. lua:staticmethod:: makeIdentity() -> Quatf

   .. lua:staticmethod:: slerp(Quatf q1, Quatf q2, float t) -> Quatf
   .. lua:staticmethod:: slerpShortestArc(Quatf q1, Quatf q2, float t) -> Quatf
   .. lua:staticmethod:: squad(Quatf q1, Quatf q2, Quatf qa, Quatf qb, \
                               float t) -> Quatf
   .. lua:staticmethod:: intermediate(Quatf q0, Quatf q1, Quatf q2) -> Quatf
   .. lua:staticmethod:: intermediate(Quatf q0, Quatf q1, Quatf q2, Quatf q3, \
                                      Quatf& qa, Quatf& qb)
   .. lua:staticmethod:: intermediate(Quatf q0, Quatf q1, Quatf q2, Quatf q3) \
                           -> Quatf, Quatf

Imath.Quatd
^^^^^^^^^^^

.. lua:class:: Quatd

   .. lua:attribute:: double r
   .. lua:attribute:: V3d v

   .. lua:method:: Quatd() -> Quatd
   .. lua:method:: Quatd(Quatd) -> Quatd
   .. lua:method:: Quatd(Quatf) -> Quatd
   .. lua:method:: Quatd(double s, double i, double j, double k) -> Quatd
   .. lua:method:: Quatd(double s, V3d d) -> Quatd
   .. lua:method:: Quatd(double s, table[3] t) -> Quatd
   .. lua:method:: Quatd(table[4] t) -> Quatd

   .. lua:method:: operator==(Quatd q) const -> boolean
   .. lua:method:: operator!=(Quatd q) const -> boolean
   .. lua:method:: operator[](int idx) const -> double
   .. lua:method:: operator[](int idx, double value)
   .. lua:method:: operator*(M33d m) const -> M33d
   .. lua:method:: operator*(Quatd q) const -> Quatd
   .. lua:method:: operator*(double s) const -> Quatd
   .. lua:method:: operator/(Quatd q) const -> Quatd
   .. lua:method:: operator/(double s) const -> Quatd
   .. lua:method:: operator+(Quatd q) const -> Quatd
   .. lua:method:: operator-(Quatd q) const -> Quatd
   .. lua:method:: operator-() const -> Quatd
   .. lua:method:: operator^(Quatd q) const -> Quatd
   .. lua:method:: not_() const -> Quatd

   .. lua:method:: invert() -> Quatd&
   .. lua:method:: inverse() const -> Quatd
   .. lua:method:: normalize() -> Quatd&
   .. lua:method:: normalized() const -> Quatd
   .. lua:method:: length() const -> double
   .. lua:method:: rotateVector(V3d original) const -> V3d
   .. lua:method:: euclideanInnerProduct(Quatd q) const -> double

   .. lua:method:: setAxisAngle(V3d axis, double radians) -> Quatd&
   .. lua:method:: setRotation(V3d fromDirection, V3d toDirection) -> Quatd&

   .. lua:method:: angle() const -> double
   .. lua:method:: axis() const -> V3d

   .. lua:method:: toMatrix33() const -> M33d
   .. lua:method:: toMatrix44() const -> M44d

   .. lua:method:: log() const -> Quatd
   .. lua:method:: exp() const -> Quatd

   .. lua:method:: toTable() const -> table[4]

   .. lua:staticmethod:: makeIdentity() -> Quatd

   .. lua:staticmethod:: slerp(Quatd q1, Quatd q2, double t) -> Quatd
   .. lua:staticmethod:: slerpShortestArc(Quatd q1, Quatd q2, double t) -> Quatd
   .. lua:staticmethod:: squad(Quatd q1, Quatd q2, Quatd qa, Quatd qb, \
                               double t) -> Quatd
   .. lua:staticmethod:: intermediate(Quatd q0, Quatd q1, Quatd q2) -> Quatd
   .. lua:staticmethod:: intermediate(Quatd q0, Quatd q1, Quatd q2, Quatd q3, \
                                      Quatd& qa, Quatd& qb)
   .. lua:staticmethod:: intermediate(Quatd q0, Quatd q1, Quatd q2, Quatd q3) \
                           -> Quatd, Quatd