magic-pixels
    Preparing search index...

    Class Matrix

    Matrix

    Index
    • Parameters

      • values: number[]
      • Optionaloptions: { numCols: number; numRows: number }

      Returns Matrix

    numCols: number
    numRows: number
    values: number[]
    • get column at a given index

      Parameters

      • column: number

        index of column starting from 0

      Returns number[]

      column as an array of numbers

    • calculate determinant, implemented for mat2, mat3, mat4

      Returns number

    • check for equality

      Parameters

      • otherMatrix: Matrix

        matrix to compare

      Returns boolean

      true or false

    • Checks if the matrix contains NaN or Infinity values

      Returns boolean

      true if all values are finite (neither NaN nor Infinity)

    • Checks if the matrix contains NaN values

      Returns boolean

      true if one of the values is NaN

    • check for rough equality (because in JS, .1+.2 !== .3)

      Parameters

      • otherMatrix: Matrix

        matrix to compare

      • delta: number = 1e-14

        tolerance, by default 1e-14

      Returns boolean

      true or false

    • get row at a given index

      Parameters

      • row: number

        index of row starting from 0

      Returns number[]

      row as an array of numbers

    • convert matrix to string

      Returns string

      a string containing matROWSxCOLS(comma-separated-values)

    • get value at a given position

      Parameters

      • row: number

        row index starting from 0

      • column: number

        column index starting from 0

      Returns number

    • Converts a vector with dimension n into a matrix with 1 col and n rows useful for matrix multiplication

      Parameters

      • value: Vector

        the input vector

      Returns Matrix

    • create identity matrix

      Parameters

      • dimension: number

        dimension of the matrix

      Returns Matrix