UNPKG

2d-physics-engine

Version:

A lightweight, flexible 2D physics engine with ECS architecture, built with TypeScript

25 lines 1.02 kB
export declare class Matrix { readonly rowsCount: number; readonly colsCount: number; private _data; constructor(rowsCount: number, colsCount: number, fill?: number); /** ---------------- STATIC HELPERS ---------------- **/ static isValid(matrix: number[][]): boolean; static identity(size: number): Matrix; static rotation2D(radians: number): Matrix; /** ---------------- BASIC OPERATIONS ---------------- **/ add(matrix: Matrix): Matrix; subtract(matrix: Matrix): Matrix; multiplyBy(scalar: number): Matrix; multiply(matrix: Matrix): Matrix; /** ---------------- EXTRA UTILITIES ---------------- **/ transpose(): Matrix; clone(): Matrix; equals(matrix: Matrix, tolerance?: number): boolean; /** ---------------- INTERNAL HELPERS ---------------- **/ private _assertSameDimensions; /** ---------------- GETTERS / SETTERS ---------------- **/ get data(): number[][]; set data(newData: number[][]); } //# sourceMappingURL=Matrix.d.ts.map