Skip to main content

mat2

Class

A 2x2 matrix.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Index

Constructors

Constructor

new mat2(): mat2

Returns

mat2

Properties

column0

column0: vec2

The first column of the matrix.


column1

column1: vec2

The second column of the matrix.


description

description: string

Returns a string representation of the matrix.

Methods

add()

add(mat): mat2

Returns the result of adding the two matrices together.

Parameters

ParameterType
matmat2

Returns

mat2


determinant()

determinant(): number

Returns the determinant of the matrix.

Returns

number


div()

div(mat): mat2

Returns the result of dividing the two matrices.

Parameters

ParameterType
matmat2

Returns

mat2


equal()

equal(mat): boolean

Returns whether the two matrices are equal.

Parameters

ParameterType
matmat2

Returns

boolean


identity()

static identity(): mat2

Returns the identity matrix.

Returns

mat2


inverse()

inverse(): mat2

Returns the inverse of the matrix.

Returns

mat2


mult()

mult(mat): mat2

Returns the result of multiplying the two matrices.

Parameters

ParameterType
matmat2

Returns

mat2


multiplyScalar()

multiplyScalar(scalar): mat2

Returns the result of scalar multiplying the matrix.

Parameters

ParameterType
scalarnumber

Returns

mat2


sub()

sub(mat): mat2

Returns the result of subtracting the two matrices.

Parameters

ParameterType
matmat2

Returns

mat2


toString()

toString(): string

Returns a string representation of the matrix.

Returns

string


transpose()

transpose(): mat2

Returns the transpose of this matrix.

Returns

mat2


zero()

static zero(): mat2

Returns a matrix with all zero values.

Returns

mat2