Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/gmath/src/matrix3.ts>Matrix3

🎮 A wasm accelerated game and graphics maths library for deno
Latest
class Matrix3
import { Matrix3 } from "https://deno.land/x/gmath@0.1.12/src/matrix3.ts";

Constructors

new
Matrix3()
new
Matrix3(ptr: number)
new
Matrix3()
new
Matrix3(
x?: Vector3 | number,
y?: Vector3,
z?: Vector3,
)

Properties

readonly
ptr: number
[0]: [number, number, number]
[1]: [number, number, number]
[2]: [number, number, number]

Methods

add(other: Matrix3 | number): Matrix3

Creates a new Matrix3 with the same values

col(n: 0 | 1 | 2): [number, number, number]
determinant(): number
diag(): [number, number, number]
eq(other: Matrix3): boolean
invert(): Matrix3 | undefined
isFinite(): boolean
mul(other: Matrix3 | number): Matrix3
row(n: 0 | 1 | 2): [number, number, number]
sub(other: Matrix3 | number): Matrix3
toArray(): [[number, number, number], [number, number, number], [number, number, number]]
toFloat32Array(): Float32Array
trace(): number

Static Methods

from(
c0r0: number,
c0r1: number,
c0r2: number,
c1r0: number,
c1r1: number,
c1r2: number,
c2r0: number,
c2r1: number,
c2r2: number,
)

Constructs a Matrix3 from individual elements

fromNonuniformScale(x: number, y: number): Matrix3
fromScale(scale: number): Matrix3
lookAtLh(
eye: Vector2,
center: Vector2,
up: Vector2,
): Matrix3
lookAtRh(
eye: Vector2,
center: Vector2,
up: Vector2,
): Matrix3