Matrix3

class Matrix3(val m00: Float, val m01: Float, val m02: Float, val m10: Float, val m11: Float, val m12: Float, val m20: Float, val m21: Float, val m22: Float)

Represents a 3x3 matrix.

Note: Matrix3 is implemented in row-major order.

The Matrix3 follows basic calculation principles:

  1. Associativity: (m1 * m2) * m3 = m1 * (m2 * m3).

  2. Distributivity: (m1 + m2) * m3 = (m1 * m3) + (m2 * m3).

Constructors

Link copied to clipboard
constructor(m00: Float, m01: Float, m02: Float, m10: Float, m11: Float, m12: Float, m20: Float, m21: Float, m22: Float)
constructor(another: Matrix3)

Constructs to generate a new Matrix3 based on another Matrix3 instance.

Types

Link copied to clipboard
object Companion

The companion object of Matrix3.

Properties

Link copied to clipboard

Gets the basis vector representing the Z-axis of the coordinate system after this matrix's transformation. This is commonly referred to as the "forward" vector.

Link copied to clipboard
val m00: Float

The item locates in row index 0 and column index 0.

Link copied to clipboard
val m01: Float

The item locates in row index 0 and column index 1.

Link copied to clipboard
val m02: Float

The item locates in row index 0 and column index 2.

Link copied to clipboard
val m10: Float

The item locates in row index 1 and column index 0.

Link copied to clipboard
val m11: Float

The item locates in row index 1 and column index 1.

Link copied to clipboard
val m12: Float

The item locates in row index 1 and column index 2.

Link copied to clipboard
val m20: Float

The item locates in row index 2 and column index 0.

Link copied to clipboard
val m21: Float

The item locates in row index 2 and column index 1.

Link copied to clipboard
val m22: Float

The item locates in row index 2 and column index 2.

Link copied to clipboard

Gets the basis vector representing the X-axis of the coordinate system after this matrix's transformation. This is commonly referred to as the "right" vector.

Link copied to clipboard
val up: Vector3

Gets the basis vector representing the Y-axis of the coordinate system after this matrix's transformation. This is commonly referred to as the "up" vector.

Functions

Link copied to clipboard
operator fun dec(): Matrix3

Overloads the unary decrement operator (--).

Link copied to clipboard
fun determinant(): Float

Calculates the determinant of this 3x3 matrix.

Link copied to clipboard
operator fun div(scale: Float): Matrix3

Overloads the / operator to perform element-wise division of this matrix by a scalar value.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(row: Int, col: Int): Float

Gets the item with the row and column index from the Matrix3 instance.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
operator fun inc(): Matrix3

Overloads the unary increment operator (++).

Link copied to clipboard

Calculates the inverse of this 3x3 matrix.

Link copied to clipboard
fun isFinite(): Boolean

Check if the Matrix3 instance value is finite.

Link copied to clipboard
operator fun minus(other: Matrix3): Matrix3

Overloads the - operator to perform element-wise subtraction of another Matrix3 from this matrix.

Link copied to clipboard
operator fun plus(other: Matrix3): Matrix3

Overloads the + operator to perform element-wise addition of this matrix with another Matrix3.

Link copied to clipboard
operator fun times(other: Matrix3): Matrix3

Overloads the * operator to perform matrix multiplication of this matrix by another Matrix3 (this * other).

operator fun times(other: Vector3): Vector3

Overloads the * operator to transform a 3D vector by this matrix.

operator fun times(scale: Float): Matrix3

Overloads the * operator to perform element-wise multiplication of this matrix by a scalar value.

Link copied to clipboard
fun toFloatArray(): FloatArray

Converts the Matrix3 to a float array.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Gets the transposed matrix of this matrix.

Link copied to clipboard
operator fun unaryMinus(): Matrix3

Overloads the unary minus operator (-) to perform element-wise negation of this matrix.