Matrix2

A matrix with 2 rows and 2 columns
Meta name Allowed other parameters Meta execution method
__le
  • Matrix2
x <= y
__eq
  • Matrix2
x == y
__mul
  • Number
  • Matrix2
  • Vector2
x * y
__add
  • Matrix2
x + y
__sub
  • Matrix2
x - y
__len
#x

Matrix2.add

Adds the other matrix to this one
Returns self for chaining
overload 1:
Matrix2:add(other)
Method Property Fluent Description Representation
other accepts a Matrix2
Return Value a Matrix2

Matrix2.scale

Scales this matrix by the specified amount, changing the values inside
Returns self for chaining
overload 1:
Matrix2:scale(vec)
Method Property Fluent Description Representation
vec accepts a Vector2
Return Value a Matrix2
overload 2:
Matrix2:scale(x, y)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
Return Value a Matrix2

Matrix2.apply

Treats the given values as a vector, augments this vector with a 1, multiplies it against the matrix, and returns a deaugmented vector of the first values
overload 1:
Matrix2:apply(x)
Method Property Fluent Description Representation
x accepts a Number
Return Value a Number

Matrix2.set

Sets this matrix to have the same values as the matrix passed in
Returns self for chaining
overload 1:
Matrix2:set(other)
Method Property Fluent Description Representation
other accepts a Matrix2
Return Value a Matrix2

Matrix2.copy

Creates and returns a new copy of this matrix
overload 1:
Matrix2:copy()
Method Property Fluent Description Representation
Return Value a Matrix2

Matrix2.reset

Resets this matrix back to the identity matrix
Returns self for chaining
overload 1:
Matrix2:reset()
Method Property Fluent Description Representation
Return Value a Matrix2

Matrix2.multiply

Multiplies this matrix by the other matrix, with the other matrix on the left
Returns self for chaining
overload 1:
Matrix2:multiply(other)
Method Property Fluent Description Representation
other accepts a Matrix2
Return Value a Matrix2

Matrix2.rotate

Rotates this matrix by the specified amount, changing the values inside
Angles are given in degrees
Returns self for chaining
overload 1:
Matrix2:rotate(degrees)
Method Property Fluent Description Representation
degrees accepts a Number
Return Value a Matrix2

Matrix2.sub

Subtracts the other matrix from this one
Returns self for chaining
overload 1:
Matrix2:sub(other)
Method Property Fluent Description Representation
other accepts a Matrix2
Return Value a Matrix2

Matrix2.getColumn

Gets the given column of this matrix, as a vector
Indexing starts at 1,
as usual
overload 1:
Matrix2:getColumn(col)
Method Property Fluent Description Representation
col accepts an Integer
Return Value a Vector2

Matrix2.inverted

Returns a copy of this matrix, but inverted
overload 1:
Matrix2:inverted()
Method Property Fluent Description Representation
Return Value a Matrix2

Matrix2.augmented

Augments this matrix, adding an additional row and column
Puts a 1 along the diagonal in the new spot,
and the rest are zero
overload 1:
Matrix2:augmented()
Method Property Fluent Description Representation
Return Value a Matrix3

Matrix2.invert

Inverts this matrix, changing the values inside
Returns self for chaining
overload 1:
Matrix2:invert()
Method Property Fluent Description Representation
Return Value a Matrix2

Matrix2.getRow

Gets the given row of this matrix, as a vector
Indexing starts at 1,
as usual
overload 1:
Matrix2:getRow(row)
Method Property Fluent Description Representation
row accepts an Integer
Return Value a Vector2

Matrix2.rightMultiply

Multiplies this matrix by the other matrix, with the other matrix on the right
Returns self for chaining
overload 1:
Matrix2:rightMultiply(other)
Method Property Fluent Description Representation
other accepts a Matrix2
Return Value a Matrix2

Matrix2.applyDir

Treats the given values as a vector, augments this vector with a 0, multiplies it against the matrix, and returns a deaugmented vector of the first values
overload 1:
Matrix2:applyDir(x)
Method Property Fluent Description Representation
x accepts a Number
Return Value a Number

Matrix2.transposed

Returns a copy of this matrix, but transposed
Transposing means to swap the rows and the columns
overload 1:
Matrix2:transposed()
Method Property Fluent Description Representation
Return Value a Matrix2

Matrix2.det

Calculates and returns the determinant of this matrix
overload 1:
Matrix2:det()
Method Property Fluent Description Representation
Return Value a Number

Matrix2.transpose

Transposes this matrix, changing the values inside
Transposing means to swap the rows and the columns
Returns self for chaining
overload 1:
Matrix2:transpose()
Method Property Fluent Description Representation
Return Value a Matrix2
a a