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

x/gmath/src/matrix2.ts>Matrix2

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

Constructors

new
Matrix2()
new
Matrix2(ptr: number)
new
Matrix2(x: Vector2, y: Vector2)
new
Matrix2(x?: Vector2 | number, y?: Vector2)

Properties

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

Methods

add(other: Matrix2 | number): Matrix2

Creates a new Matrix2 with the same values

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

Static Methods

from(
c0r0: number,
c0r1: number,
c1r0: number,
c1r1: number,
)

Constructs a Matrix2 from individual elements