API Docs for: 0.5.5
Show:

kick.math.Mat2d Class

Defined in: kick/math/Mat2d.js:4
Module: kick.math

Mat2 - 2x3 Matrix A mat2d contains six elements defined as:

[a, b,
 c, d,
 tx,ty]
This is a short form for the 3x3 matrix:

[a, b, 0
 c, d, 0
 tx,ty,1]
The last column is ignored so the array is shorter and operations are faster.

Item Index

Methods

Methods

clone

(
  • a
)
kick.math.Mat2d static

Creates a new mat2d initialized with values from an existing matrix

Parameters:

Returns:

kick.math.Mat2d:

a new 2x3 matrix

copy

(
  • out
  • a
)
kick.math.Mat2d static

Copy the values from one mat2d to another

Parameters:

Returns:

create

() kick.math.Mat2d static

Creates a new identity mat2d

Returns:

kick.math.Mat2d:

New mat2d

determinant

(
  • a
)
Number static

Calculates the determinant of a Mat2d

Parameters:

Returns:

Number:

determinant of a

identity

(
  • out
)
kick.math.Mat2d static

Sets a Mat2d to the identity matrix

Parameters:

Returns:

invert

(
  • out
  • a
)
kick.math.Mat2d static

Inverts a Mat2d

Parameters:

Returns:

multiply

(
  • out
  • a
  • b
)
kick.math.Mat2d static

Multiplies two Mat2d's

Parameters:

Returns:

rotate

(
  • out
  • a
  • rad
)
kick.math.Mat2d static

Rotates a mat2d by the given angle

Parameters:

Returns:

scale

(
  • out
  • a
  • v
)
kick.math.Mat2d static

Scales the mat2d by the dimensions in the given vec2

Parameters:

Returns:

str

(
  • a
)
String static

Returns a string representation of a Mat2d

Parameters:

Returns:

String:

string representation of the matrix

strPretty

(
  • mat
)
String static

Returns a string representation of a Mat2d printed as a 3x3 matrix (on 3 lines)

Parameters:

Returns:

String:

string representation of mat

translate

(
  • out
  • a
  • v
)
kick.math.Mat2d static

Translates the mat2d by the dimensions in the given vec2

Parameters:

Returns: