Function canInvertMatrix

  • This function is a simple utility function to check whether a matrix has an inverse

    Remarks

    A matrix doesn't have an inverse if it's determinant is 0

    Example

    const matrix1 = new Matrix([6, 4, 4, 4,
    5, 5, 7, 6,
    4, -9, 3, -7,
    9, 1, 7, -6], 4, 4)
    const matrix2 = new Matrix([-4, 2, -2, -3,
    9, 6, 2, 6,
    0, -5, 1, -5,
    0, 0, 0, 0], 4, 4)
    canInvertMatrix(matrix1) //-> true
    canInvertMatrix(matrix2) //-> false

    Parameters

    • matrix: Matrix

      matrix to check for invertability

    Returns boolean

Generated using TypeDoc