pub fn mat4x3_inv<T>(mat: Matrix4x3<T>) -> Matrix4x3<T>
    where T: Copy + traits::One + Add<T, Output = T> + Mul<T, Output = T>
        + Sub<T, Output = T> + Div<T, Output = T>
{
    let inv_det = mat4x3_inv_det(mat);

    [
        [   (
                  mat[1][1] * mat[2][2]
                - mat[1][2] * mat[2][1]
            ) * inv_det,
            (
                  mat[0][2] * mat[2][1]
                - mat[0][1] * mat[2][2]
            ) * inv_det,
            (
                  mat[0][1] * mat[1][2]
                - mat[0][2] * mat[1][1]
            ) * inv_det
        ],
        [
            (
                  mat[1][2] * mat[2][0]
                - mat[1][0] * mat[2][2]
            ) * inv_det,
            (
                  mat[0][0] * mat[2][2]
                - mat[0][2] * mat[2][0]
            ) * inv_det,
            (
                  mat[0][2] * mat[1][0]
                - mat[0][0] * mat[1][2]
            ) * inv_det
        ],
        [
            (
                  mat[1][0] * mat[2][1]
                - mat[1][1] * mat[2][0]
            ) * inv_det,
            (
                  mat[0][1] * mat[2][0]
                - mat[0][0] * mat[2][1]
            ) * inv_det,
            (
                  mat[0][0] * mat[1][1]
                - mat[0][1] * mat[1][0]
            ) * inv_det
        ],
        [
            (
                mat[1][0] * mat[2][2] * mat[3][1]
                + mat[1][1] * mat[2][0] * mat[3][2]
                + mat[1][2] * mat[2][1] * mat[3][0]
                - mat[1][0] * mat[2][1] * mat[3][2]
                - mat[1][1] * mat[2][2] * mat[3][0]
                - mat[1][2] * mat[2][0] * mat[3][1]
            ) * inv_det,
            (
                mat[0][0] * mat[2][1] * mat[3][2]
                + mat[0][1] * mat[2][2] * mat[3][0]
                + mat[0][2] * mat[2][0] * mat[3][1]
                - mat[0][0] * mat[2][2] * mat[3][1]
                - mat[0][1] * mat[2][0] * mat[3][2]
                - mat[0][2] * mat[2][1] * mat[3][0]
            ) * inv_det,
            (
                mat[0][0] * mat[1][2] * mat[3][1]
                + mat[0][1] * mat[1][0] * mat[3][2]
                + mat[0][2] * mat[1][1] * mat[3][0]
                - mat[0][0] * mat[1][1] * mat[3][2]
                - mat[0][1] * mat[1][2] * mat[3][0]
                - mat[0][2] * mat[1][0] * mat[3][1]
            ) * inv_det
        ]
    ]
}
/// Computes the inverse of a 4x3 matrix.
Computes the inverse of a 4x3 matrix.
Computes the inverse of a 4x3 matrix .
pub fn mat4x3_inv<T>(mat: Matrix4x3<T>) -> Matrix4x3<T>
    where T: Copy + traits::One + Add<T, Output = T> + Mul<T, Output = T>
        + Sub<T, Output = T> + Div<T, Output = T>
{
    let inv_det = mat4x3_inv_det(mat);
    [
        [   (
                  mat[1][1] * mat[2][2]
                - mat[1][2] * mat[2][1]
            ) * inv_det,
            (
                  mat[0][2] * mat[2][1]
                - mat[0][1] * mat[2][2]
            ) * inv_det,
            (
                  mat[0][1] * mat[1][2]
                - mat[0][2] * mat[1][1]
            ) * inv_det
        ],
        [
            (
                  mat[1][2] * mat[2][0]
                - mat[1][0] * mat[2][2]
            ) * inv_det,
            (
                  mat[0][0] * mat[2][2]
                - mat[0][2] * mat[2][0]
            ) * inv_det,
            (
                  mat[0][2] * mat[1][0]
                - mat[0][0] * mat[1][2]
            ) * inv_det
        ],
        [
            (
                  mat[1][0] * mat[2][1]
                - mat[1][1] * mat[2][0]
            ) * inv_det,
            (
                  mat[0][1] * mat[2][0]
                - mat[0][0] * mat[2][1]
            ) * inv_det,
            (
                  mat[0][0] * mat[1][1]
                - mat[0][1] * mat[1][0]
            ) * inv_det
        ],
        [
            (
                mat[1][0] * mat[2][2] * mat[3][1]
                + mat[1][1] * mat[2][0] * mat[3][2]
                + mat[1][2] * mat[2][1] * mat[3][0]
                - mat[1][0] * mat[2][1] * mat[3][2]
                - mat[1][1] * mat[2][2] * mat[3][0]
                - mat[1][2] * mat[2][0] * mat[3][1]
            ) * inv_det,
            (
                mat[0][0] * mat[2][1] * mat[3][2]
                + mat[0][1] * mat[2][2] * mat[3][0]
                + mat[0][2] * mat[2][0] * mat[3][1]
                - mat[0][0] * mat[2][2] * mat[3][1]
                - mat[0][1] * mat[2][0] * mat[3][2]
                - mat[0][2] * mat[2][1] * mat[3][0]
            ) * inv_det,
            (
                mat[0][0] * mat[1][2] * mat[3][1]
                + mat[0][1] * mat[1][0] * mat[3][2]
                + mat[0][2] * mat[1][1] * mat[3][0]
                - mat[0][0] * mat[1][1] * mat[3][2]
                - mat[0][1] * mat[1][2] * mat[3][0]
                - mat[0][2] * mat[1][0] * mat[3][1]
            ) * inv_det
        ]
    ]
}
pub fn mat4x3_inv < T > ( mat : Matrix4x3 < T > ) -> Matrix4x3 < T > where T : Copy + traits :: One + Add < T , Output = T > + Mul < T , Output = T > + Sub < T , Output = T > + Div < T , Output = T > { let inv_det = mat4x3_inv_det ( mat ) ; [ [ ( mat [ 1 ] [ 1 ] * mat [ 2 ] [ 2 ] - mat [ 1 ] [ 2 ] * mat [ 2 ] [ 1 ] ) * inv_det , ( mat [ 0 ] [ 2 ] * mat [ 2 ] [ 1 ] - mat [ 0 ] [ 1 ] * mat [ 2 ] [ 2 ] ) * inv_det , ( mat [ 0 ] [ 1 ] * mat [ 1 ] [ 2 ] - mat [ 0 ] [ 2 ] * mat [ 1 ] [ 1 ] ) * inv_det ] , [ ( mat [ 1 ] [ 2 ] * mat [ 2 ] [ 0 ] - mat [ 1 ] [ 0 ] * mat [ 2 ] [ 2 ] ) * inv_det , ( mat [ 0 ] [ 0 ] * mat [ 2 ] [ 2 ] - mat [ 0 ] [ 2 ] * mat [ 2 ] [ 0 ] ) * inv_det , ( mat [ 0 ] [ 2 ] * mat [ 1 ] [ 0 ] - mat [ 0 ] [ 0 ] * mat [ 1 ] [ 2 ] ) * inv_det ] , [ ( mat [ 1 ] [ 0 ] * mat [ 2 ] [ 1 ] - mat [ 1 ] [ 1 ] * mat [ 2 ] [ 0 ] ) * inv_det , ( mat [ 0 ] [ 1 ] * mat [ 2 ] [ 0 ] - mat [ 0 ] [ 0 ] * mat [ 2 ] [ 1 ] ) * inv_det , ( mat [ 0 ] [ 0 ] * mat [ 1 ] [ 1 ] - mat [ 0 ] [ 1 ] * mat [ 1 ] [ 0 ] ) * inv_det ] , [ ( mat [ 1 ] [ 0 ] * mat [ 2 ] [ 2 ] * mat [ 3 ] [ 1 ] + mat [ 1 ] [ 1 ] * mat [ 2 ] [ 0 ] * mat [ 3 ] [ 2 ] + mat [ 1 ] [ 2 ] * mat [ 2 ] [ 1 ] * mat [ 3 ] [ 0 ] - mat [ 1 ] [ 0 ] * mat [ 2 ] [ 1 ] * mat [ 3 ] [ 2 ] - mat [ 1 ] [ 1 ] * mat [ 2 ] [ 2 ] * mat [ 3 ] [ 0 ] - mat [ 1 ] [ 2 ] * mat [ 2 ] [ 0 ] * mat [ 3 ] [ 1 ] ) * inv_det , ( mat [ 0 ] [ 0 ] * mat [ 2 ] [ 1 ] * mat [ 3 ] [ 2 ] + mat [ 0 ] [ 1 ] * mat [ 2 ] [ 2 ] * mat [ 3 ] [ 0 ] + mat [ 0 ] [ 2 ] * mat [ 2 ] [ 0 ] * mat [ 3 ] [ 1 ] - mat [ 0 ] [ 0 ] * mat [ 2 ] [ 2 ] * mat [ 3 ] [ 1 ] - mat [ 0 ] [ 1 ] * mat [ 2 ] [ 0 ] * mat [ 3 ] [ 2 ] - mat [ 0 ] [ 2 ] * mat [ 2 ] [ 1 ] * mat [ 3 ] [ 0 ] ) * inv_det , ( mat [ 0 ] [ 0 ] * mat [ 1 ] [ 2 ] * mat [ 3 ] [ 1 ] + mat [ 0 ] [ 1 ] * mat [ 1 ] [ 0 ] * mat [ 3 ] [ 2 ] + mat [ 0 ] [ 2 ] * mat [ 1 ] [ 1 ] * mat [ 3 ] [ 0 ] - mat [ 0 ] [ 0 ] * mat [ 1 ] [ 1 ] * mat [ 3 ] [ 2 ] - mat [ 0 ] [ 1 ] * mat [ 1 ] [ 2 ] * mat [ 3 ] [ 0 ] - mat [ 0 ] [ 2 ] * mat [ 1 ] [ 0 ] * mat [ 3 ] [ 1 ] ) * inv_det ] ] }
Computes the inverse of a 4x3 matrix.
Computes the inverse of a 4x3 matrix .
mat
Matrix4x3<T>
mat
Matrix4x3<T>