Matrix
======

.. lua:module:: Imath

Imath.M33f
^^^^^^^^^^

.. lua:class:: M33f

   .. lua:method:: M33f() -> M33f
   .. lua:method:: M33f(M33f m) -> M33f
   .. lua:method:: M33f(M33d m) -> M33f
   .. lua:method:: M33f(float a) -> M33f
   .. lua:method:: M33f(float a, float b, float c, float d, float e, float f, \
                        float g, float h, float i) -> M33f
   .. lua:method:: M33f(table[9] t) -> M33f

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

   .. lua:method:: makeIdentity()

   .. lua:method:: equalWithAbsError(M33f m, float e) const -> boolean
   .. lua:method:: equalWithRelError(M33f m, float e) const -> boolean

   .. lua:method:: negate() -> M33f&

   .. lua:method:: multVecMatrix(V2f v) const -> V2f
   .. lua:method:: multDirMatrix(V2f v) const -> V2f

   .. lua:method:: transpose() -> M33f&
   .. lua:method:: transposed() const -> M33f

   .. lua:method:: invert() -> M33f&
   .. lua:method:: invert(boolean singExc) -> M33f&

   .. lua:method:: inverse() const -> M33f
   .. lua:method:: inverse(boolean singExc) const -> M33f

   .. lua:method:: gjInvert() -> M33f&
   .. lua:method:: gjInvert(boolean singExc) -> M33f&

   .. lua:method:: gjInverse() const -> M33f
   .. lua:method:: gjInverse(boolean singExc) const -> M33f

   .. lua:method:: minorOf(int r, int c) const -> float
   .. lua:method:: fastMinor(int r0, int r1, int c0, int c1) const -> float
   .. lua:method:: determinant() const -> float

   .. lua:method:: setRotation(float r) -> M33f&
   .. lua:method:: rotate(float r) -> M33f&
   .. lua:method:: setScale(float s) -> M33f&
   .. lua:method:: setScale(V2f s) -> M33f&
   .. lua:method:: scale(V2f s) -> M33f&
   .. lua:method:: setTranslation(V2f t) -> M33f&
   .. lua:method:: translation() const -> V2f
   .. lua:method:: translate(V2f t) -> M33f&
   .. lua:method:: setShear(float h) -> M33f&
   .. lua:method:: setShear(V2f h) -> M33f&
   .. lua:method:: shear(float xy) -> M33f&
   .. lua:method:: shear(V2f h) -> M33f&

   .. lua:method:: extractScaling([boolean exc=true]) const -> V2f, boolean
   .. lua:method:: sansScaling([boolean exc=true]) const -> M33f
   .. lua:method:: removeScaling([boolean exc=true]) -> boolean
   .. lua:method:: extractScalingAndShear([boolean exc=true]) const \
                     -> V2f, float, boolean
   .. lua:method:: sansScalingAndShear([boolean exc=true]) const -> M33f
   .. lua:method:: removeScalingAndShear([boolean exc=true]) -> boolean
   .. lua:method:: extractAndRemoveScalingAndShear([boolean exc=true]) const \
                     -> V2f, float, boolean
   .. lua:method:: extractEuler() const -> float
   .. lua:method:: extractSHRT([boolean exc=true]) const \
                     -> V2f, float, float, V2f, boolean

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

   .. lua:staticmethod:: dimensions() -> int
   .. lua:staticmethod:: baseTypeLowest() -> float
   .. lua:staticmethod:: baseTypeMax() -> float
   .. lua:staticmethod:: baseTypeSmallest() -> float
   .. lua:staticmethod:: baseTypeEpsilon() -> float

   .. lua:staticmethod:: checkForZeroScaleInRow(float scl, V2f row[, \
                                                boolean exc=true]) -> boolean
   .. lua:staticmethod:: outerProduct(V3f a, V3f b) -> M33f
   .. lua:staticmethod:: extractEuler(M33f matrix, float outRot)

Imath.M33d
^^^^^^^^^^

.. lua:class:: M33d

   .. lua:method:: M33d() -> M33d
   .. lua:method:: M33d(M33d m) -> M33d
   .. lua:method:: M33d(M33f m) -> M33d
   .. lua:method:: M33d(double a) -> M33d
   .. lua:method:: M33d(double a, double b, double c, double d, double e, \
                        double f, double g, double h, double i) -> M33d
   .. lua:method:: M33d(table[9] t) -> M33d

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

   .. lua:method:: makeIdentity()

   .. lua:method:: equalWithAbsError(M33d m, double e) const -> boolean
   .. lua:method:: equalWithRelError(M33d m, double e) const -> boolean

   .. lua:method:: negate() -> M33d&

   .. lua:method:: multVecMatrix(V2d v) const -> V2d
   .. lua:method:: multDirMatrix(V2d v) const -> V2d

   .. lua:method:: transpose() -> M33d&
   .. lua:method:: transposed() const -> M33d

   .. lua:method:: invert() -> M33d&
   .. lua:method:: invert(boolean singExc) -> M33d&

   .. lua:method:: inverse() const -> M33d
   .. lua:method:: inverse(boolean singExc) const -> M33d

   .. lua:method:: gjInvert() -> M33d&
   .. lua:method:: gjInvert(boolean singExc) -> M33d&

   .. lua:method:: gjInverse() const -> M33d
   .. lua:method:: gjInverse(boolean singExc) const -> M33d

   .. lua:method:: minorOf(int r, int c) const -> double
   .. lua:method:: fastMinor(int r0, int r1, int c0, int c1) const -> double
   .. lua:method:: determinant() const -> double

   .. lua:method:: setRotation(double r) -> M33d&
   .. lua:method:: rotate(double r) -> M33d&
   .. lua:method:: setScale(double s) -> M33d&
   .. lua:method:: setScale(V2d s) -> M33d&
   .. lua:method:: scale(V2d s) -> M33d&
   .. lua:method:: setTranslation(V2d t) -> M33d&
   .. lua:method:: translation() const -> V2d
   .. lua:method:: translate(V2d t) -> M33d&
   .. lua:method:: setShear(double h) -> M33d&
   .. lua:method:: setShear(V2d h) -> M33d&
   .. lua:method:: shear(double xy) -> M33d&
   .. lua:method:: shear(V2d h) -> M33d&

   .. lua:method:: extractScaling([boolean exc=true]) const -> V2d, boolean
   .. lua:method:: sansScaling([boolean exc=true]) const -> M33d
   .. lua:method:: removeScaling([boolean exc=true]) -> boolean
   .. lua:method:: extractScalingAndShear([boolean exc=true]) const \
                     -> V2d, double, boolean
   .. lua:method:: sansScalingAndShear([boolean exc=true]) const -> M33d
   .. lua:method:: removeScalingAndShear([boolean exc=true]) -> boolean
   .. lua:method:: extractAndRemoveScalingAndShear([boolean exc=true]) const \
                     -> V2d, double, boolean
   .. lua:method:: extractEuler() const -> double
   .. lua:method:: extractSHRT([boolean exc=true]) const \
                     -> V2d, double, double, V2d, boolean

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

   .. lua:staticmethod:: dimensions() -> int
   .. lua:staticmethod:: baseTypeLowest() -> double
   .. lua:staticmethod:: baseTypeMax() -> double
   .. lua:staticmethod:: baseTypeSmallest() -> double
   .. lua:staticmethod:: baseTypeEpsilon() -> double

   .. lua:staticmethod:: checkForZeroScaleInRow(double scl, V2f row[, \
                                                boolean exc=true]) -> boolean
   .. lua:staticmethod:: outerProduct(V3d a, V3d b) -> M33d
   .. lua:staticmethod:: extractEuler(M33d matrix, double outRot)

Imath.M44f
^^^^^^^^^^

.. lua:class:: M44f

   .. lua:method:: M44f() -> M44f
   .. lua:method:: M44f(M44f m) -> M44f
   .. lua:method:: M44f(M44d m) -> M44f
   .. lua:method:: M44f(M33f r, V3f t) -> M44f
   .. lua:method:: M44f(float a) -> M44f
   .. lua:method:: M44f(float a, float b, float c, float d, float e, float f, \
                        float g, float h, float i, float j, float k, float l, \
                        float m, float n, float o, float p) -> M44f
   .. lua:method:: M44f(table[16] t) -> M44f

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

   .. lua:method:: makeIdentity()

   .. lua:method:: equalWithAbsError(M44f m, float e) const -> boolean
   .. lua:method:: equalWithRelError(M44f m, float e) const -> boolean

   .. lua:method:: negate() -> M44f&

   .. lua:method:: multVecMatrix(V3f v) const -> V3f
   .. lua:method:: multDirMatrix(V3f v) const -> V3f

   .. lua:method:: transpose() -> M44f&
   .. lua:method:: transposed() const -> M44f

   .. lua:method:: invert() -> M44f&
   .. lua:method:: invert(boolean singExc) -> M44f&

   .. lua:method:: inverse() const -> M44f
   .. lua:method:: inverse(boolean singExc) const -> M44f

   .. lua:method:: gjInvert() -> M44f&
   .. lua:method:: gjInvert(boolean singExc) -> M44f&

   .. lua:method:: gjInverse() const -> M44f
   .. lua:method:: gjInverse(boolean singExc) const -> M44f

   .. lua:method:: minorOf(int r, int c) const -> float
   .. lua:method:: fastMinor(int r0, int r1, int r2 int c0, int c1, int c2) \
                     const -> float
   .. lua:method:: determinant() const -> float

   .. lua:method:: setEulerAngles(V3f r) -> M44f&
   .. lua:method:: setAxisAngle(V3f ax, float angle) -> M44f&
   .. lua:method:: rotate(V3f r) -> M44f&
   .. lua:method:: setScale(float s) -> M44f&
   .. lua:method:: setScale(V3f s) -> M44f&
   .. lua:method:: scale(V3f s) -> M44f&
   .. lua:method:: setTranslation(V3f t) -> M44f&
   .. lua:method:: translation() const -> V3f
   .. lua:method:: translate(V3f t) -> M44f&
   .. lua:method:: setShear(V3f h) -> M44f&
   .. lua:method:: shear(V3f h) -> M44f&

   .. lua:method:: extractScaling([boolean exc=true]) const -> V3f, boolean
   .. lua:method:: sansScaling([boolean exc=true]) const -> M44f
   .. lua:method:: removeScaling([boolean exc=true]) -> boolean
   .. lua:method:: extractScalingAndShear([boolean exc=true]) const \
                     -> V3f, V3f, boolean
   .. lua:method:: sansScalingAndShear([boolean exc=true]) const -> M44f
   .. lua:method:: removeScalingAndShear([boolean exc=true]) -> boolean
   .. lua:method:: extractAndRemoveScalingAndShear([boolean exc=true]) const \
                     -> V3f, V3f, boolean
   .. lua:method:: extractEulerXYZ() const -> V3f
   .. lua:method:: extractEulerZYX() const -> V3f
   .. lua:method:: extractQuat() const -> Quatf
   .. lua:method:: extractSHRT(boolean exc, Eulerf.Order rOrder) const \
                     -> V3f, V3f, V3f, V3f, boolean
   .. lua:method:: extractSHRT([boolean exc=true]) const \
                     -> V3f, V3f, V3f, V3f, boolean
   .. lua:method:: extractSHRT(Eulerf e[, boolean exc=true]) const \
                     -> V3f, V3f, Eulerf, V3f, boolean

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

   .. lua:staticmethod:: multiply(M44f a, M44f b) -> M44f
   .. lua:staticmethod:: multiply(M44f a, M44f b, M44f outMat)

   .. lua:staticmethod:: dimensions() -> int
   .. lua:staticmethod:: baseTypeLowest() -> float
   .. lua:staticmethod:: baseTypeMax() -> float
   .. lua:staticmethod:: baseTypeSmallest() -> float
   .. lua:staticmethod:: baseTypeEpsilon() -> float

   .. lua:staticmethod:: checkForZeroScaleInRow(float scl, V3f row[, \
                                                boolean exc=true]) -> boolean
   .. lua:staticmethod:: outerProduct(V4f a, V4f b) -> M44f

   .. lua:staticmethod:: rotationMatrix(V3f fromDirection, V3f toDirection) \
                           -> M44f
   .. lua:staticmethod:: rotationMatrixWithUpDir(V3f fromDir, V3f toDir, \
                                                 V3f upDir) -> M44f
   .. lua:staticmethod:: alignZAxisWithTargetDir(M44f& result, V3f targetDir, \
                                                 V3f upDir)
   .. lua:staticmethod:: alignZAxisWithTargetDir(V3f targetDir, V3f upDir) \
                           -> M44f
   .. lua:staticmethod:: computeLocalFrame(V3f p, V3f xDir, V3f normal) -> M44f
   .. lua:staticmethod:: addOffset(M44f inMat, V3f tOffset, V3f rOffset, \
                                   V3f sOffset, M44f ref) -> M44f
   .. lua:staticmethod:: computeRSMatrix(boolean keepRotateA, \
                                         boolean keepScaleA, M44f A, M44f B) \
                           -> M44f

Imath.M44d
^^^^^^^^^^

.. lua:class:: M44d

   .. lua:method:: M44d() -> M44d
   .. lua:method:: M44d(M44d m) -> M44d
   .. lua:method:: M44d(M44f m) -> M44d
   .. lua:method:: M44d(M33d r, V3d t) -> M44d
   .. lua:method:: M44d(double a) -> M44d
   .. lua:method:: M44d(double a, double b, double c, double d, double e,
                        double f, double g, double h, double i, double j,
                        double k, double l, double m, double n, double o,
                        double p) -> M44d
   .. lua:method:: M44d(table[16] t) -> M44d

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

   .. lua:method:: makeIdentity()

   .. lua:method:: equalWithAbsError(M44d m, double e) const -> boolean
   .. lua:method:: equalWithRelError(M44d m, double e) const -> boolean

   .. lua:method:: negate() -> M44d&

   .. lua:method:: multVecMatrix(V3d v) const -> V3d
   .. lua:method:: multDirMatrix(V3d v) const -> V3d

   .. lua:method:: transpose() -> M44d&
   .. lua:method:: transposed() const -> M44d

   .. lua:method:: invert() -> M44d&
   .. lua:method:: invert(boolean singExc) -> M44d&

   .. lua:method:: inverse() const -> M44d
   .. lua:method:: inverse(boolean singExc) const -> M44d

   .. lua:method:: gjInvert() -> M44d&
   .. lua:method:: gjInvert(boolean singExc) -> M44d&

   .. lua:method:: gjInverse() const -> M44d
   .. lua:method:: gjInverse(boolean singExc) const -> M44d

   .. lua:method:: minorOf(int r, int c) const -> double
   .. lua:method:: fastMinor(int r0, int r1, int r2 int c0, int c1, int c2) \
                     const -> double
   .. lua:method:: determinant() const -> double

   .. lua:method:: setEulerAngles(V3d r) -> M44d&
   .. lua:method:: setAxisAngle(V3d ax, double angle) -> M44d&
   .. lua:method:: rotate(V3d r) -> M44d&
   .. lua:method:: setScale(double s) -> M44d&
   .. lua:method:: setScale(V3d s) -> M44d&
   .. lua:method:: scale(V3d s) -> M44d&
   .. lua:method:: setTranslation(V3d t) -> M44d&
   .. lua:method:: translation() const -> V3d
   .. lua:method:: translate(V3d t) -> M44d&
   .. lua:method:: setShear(V3d h) -> M44d&
   .. lua:method:: shear(V3d h) -> M44d&

   .. lua:method:: extractScaling([boolean exc=true]) const -> V3d, boolean
   .. lua:method:: sansScaling([boolean exc=true]) const -> M44d
   .. lua:method:: removeScaling([boolean exc=true]) -> boolean
   .. lua:method:: extractScalingAndShear([boolean exc=true]) const \
                     -> V3d, V3d, boolean
   .. lua:method:: sansScalingAndShear([boolean exc=true]) const -> M44d
   .. lua:method:: removeScalingAndShear([boolean exc=true]) -> boolean
   .. lua:method:: extractAndRemoveScalingAndShear([boolean exc=true]) const \
                     -> V3d, V3d, boolean
   .. lua:method:: extractEulerXYZ() const -> V3d
   .. lua:method:: extractEulerZYX() const -> V3d
   .. lua:method:: extractQuat() const -> Quatd
   .. lua:method:: extractSHRT(boolean exc, Eulerd.Order rOrder) const \
                     -> V3d, V3d, V3d, V3d, boolean
   .. lua:method:: extractSHRT([boolean exc=true]) const \
                     -> V3d, V3d, V3d, V3d, boolean
   .. lua:method:: extractSHRT(Eulerd e[, boolean exc=true]) const \
                     -> V3d, V3d, Eulerd, V3d, boolean

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

   .. lua:staticmethod:: multiply(M44d a, M44d b) -> M44d
   .. lua:staticmethod:: multiply(M44d a, M44d b, M44d outMat)

   .. lua:staticmethod:: dimensions() -> int
   .. lua:staticmethod:: baseTypeLowest() -> double
   .. lua:staticmethod:: baseTypeMax() -> double
   .. lua:staticmethod:: baseTypeSmallest() -> double
   .. lua:staticmethod:: baseTypeEpsilon() -> double

   .. lua:staticmethod:: checkForZeroScaleInRow(double scl, V3d row[, \
                                                boolean exc=true]) -> boolean
   .. lua:staticmethod:: outerProduct(V4d a, V4d b) -> M44d

   .. lua:staticmethod:: rotationMatrix(V3d fromDirection, V3d toDirection) \
                           -> M44d
   .. lua:staticmethod:: rotationMatrixWithUpDir(V3d fromDir, V3d toDir, \
                                                 V3d upDir) -> M44d
   .. lua:staticmethod:: alignZAxisWithTargetDir(M44d& result, V3d targetDir, \
                                                 V3d upDir)
   .. lua:staticmethod:: alignZAxisWithTargetDir(V3d targetDir, V3d upDir) \
                           -> M44d
   .. lua:staticmethod:: computeLocalFrame(V3d p, V3d xDir, V3d normal) -> M44d
   .. lua:staticmethod:: addOffset(M44d inMat, V3d tOffset, V3d rOffset, \
                                   V3d sOffset, M44d ref) -> M44d
   .. lua:staticmethod:: computeRSMatrix(boolean keepRotateA, \
                                         boolean keepScaleA, M44d A, M44d B) \
                           -> M44d