Skip to main content

Class: Matrix3x3

Defined in: math/matrices/matrix3x3.ts:10

Represents a 3x3 transformation matrix used for 2D graphics operations. The matrix is stored in column-major order as a flat array of 9 numbers.

Matrix layout: [0 3 6] [1 4 7] [2 5 8]

Constructors

Constructor

new Matrix3x3(matrix): Matrix3x3

Defined in: math/matrices/matrix3x3.ts:18

Creates a new 3x3 matrix from the given array.

Parameters

matrix

number[]

An array of 9 numbers representing the matrix in column-major order

Returns

Matrix3x3

Accessors

matrix

Get Signature

get matrix(): Float32Array

Defined in: math/matrices/matrix3x3.ts:30

Gets the underlying matrix array.

Returns

Float32Array

The matrix data as a Float32Array in column-major order


identity

Get Signature

get static identity(): Matrix3x3

Defined in: math/matrices/matrix3x3.ts:103

Creates and returns an identity matrix.

Returns

Matrix3x3

A new identity matrix

Methods

resetToIdentity()

resetToIdentity(): this

Defined in: math/matrices/matrix3x3.ts:84

  • Resets the matrix to the identity matrix.

Returns

this


rotate()

rotate(radians): this

Defined in: math/matrices/matrix3x3.ts:52

Applies a rotation transformation to the matrix.

Parameters

radians

number

The rotation angle in radians

Returns

this

This matrix for chaining


scale()

scale(x, y): this

Defined in: math/matrices/matrix3x3.ts:74

Applies a scale transformation to the matrix.

Parameters

x

number

The x-axis scale factor

y

number

The y-axis scale factor

Returns

this

This matrix for chaining


translate()

translate(x, y): this

Defined in: math/matrices/matrix3x3.ts:40

Applies a translation transformation to the matrix.

Parameters

x

number

The x-coordinate translation

y

number

The y-coordinate translation

Returns

this

This matrix for chaining