API Docs for: 0.6.1
Show:

Mat3 Class

Defined in: src/math/Mat3.js:5

A 3x3 matrix.

Constructor

Mat3

(
  • array
)

Defined in src/math/Mat3.js:5

Parameters:

  • array Object

    elements Array of nine elements. Optional.

Methods

copy

(
  • source
)
Mat3

Copy another matrix into this matrix object.

Parameters:

Returns:

Mat3:

this

e

(
  • row
  • column
  • value
)
Number

Get an element in the matrix by index. Index starts at 0, not 1!!!

Parameters:

  • row Number
  • column Number
  • value Number

    Optional. If provided, the matrix element will be set to this value.

Returns:

Number:

getTrace

() Vec3

Defined in src/math/Mat3.js:74

Gets the matrix diagonal elements

Returns:

Vec3:

identity

()

Defined in src/math/Mat3.js:24

Sets the matrix to identity

mmult

(
  • m
)
Mat3

Matrix multiplication

Parameters:

  • m Mat3

    Matrix to multiply with from left side.

Returns:

Mat3:

The result.

reverse

(
  • target
)
Mat3

reverse the matrix

Parameters:

  • target Mat3

    Optional. Target matrix to save in.

Returns:

Mat3:

The solution x

scale

(
  • v
)
Mat3

Scale each column of the matrix

Parameters:

Returns:

Mat3:

The result.

setRotationFromQuaternion

(
  • q
)

Set the matrix from a quaterion

Parameters:

setTrace

(
  • vec3
)

Defined in src/math/Mat3.js:62

Sets the matrix diagonal elements from a Vec3

Parameters:

setZero

()

Defined in src/math/Mat3.js:45

Set all elements to zero

smult

(
  • s
)

Matrix-scalar multiplication

Parameters:

  • s Number

solve

(
  • b
  • target
)
Vec3

Solve Ax=b

Parameters:

  • b Vec3

    The right hand side

  • target Vec3

    Optional. Target vector to save in.

Returns:

Vec3:

The solution x

toString

()

Returns a string representation of the matrix.

Returns:

string

transpose

(
  • target
)
Mat3

Transpose the matrix

Parameters:

  • target Mat3

    Where to store the result.

Returns:

Mat3:

The target Mat3, or a new Mat3 if target was omitted.

vmult

(
  • v
  • target
)

Defined in src/math/Mat3.js:87

Matrix-Vector multiplication

Parameters:

  • v Vec3

    The vector to multiply with

  • target Vec3

    Optional, target to save the result in.

Properties

elements

Array

Defined in src/math/Mat3.js:13

A vector of length 9, containing all matrix elements