Namespace SpiderGL.Math.Mat3
The SpiderGL.Math.Mat3 namespace defines operations on 3x3 matrices.
- Defined in: math.js
Constructor Attributes | Constructor Name and Description |
---|---|
The SpiderGL.Math.Mat3 namespace.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
<static> |
SpiderGL.Math.Mat3.diag(d)
Creates a diagonal 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.dup(n)
Duplicates the input 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.identity()
Creates an identity 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.mul2(m, v, z)
Pre-multiplies a 2-dimensional vector by a column-major 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.mul3(m, v)
Pre-multiplies a 3-dimensional vector by a column-major 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.one()
Creates a 3x3 matrix initialized with one.
|
<static> |
SpiderGL.Math.Mat3.scalar(s)
Creates a 3x3 matrix initialized with a scalar.
|
<static> |
SpiderGL.Math.Mat3.to44(m)
Extends a 3x3 matrix to a 4x4 matrix.
|
<static> |
SpiderGL.Math.Mat3.transpose(m)
Creates the transpose of a 3x3 matrix.
|
<static> |
SpiderGL.Math.Mat3.zero()
Creates a 3x3 matrix initialized with zero.
|
Namespace Detail
SpiderGL.Math.Mat3
The SpiderGL.Math.Mat3 namespace.
The provided functions operate on 3x3 matrices, represented as standard JavaScript arrays of length 9.
In general, matrices are considered in column-major format.
Method Detail
-
<static> {array} SpiderGL.Math.Mat3.diag(d)Creates a diagonal 3x3 matrix.
- Parameters:
- {array} d
- A 3-dimensional vector
- Returns:
- {array} A new 9-component array representing a 3x3 matrix with diagonal elements set to d.
-
<static> {array} SpiderGL.Math.Mat3.dup(n)Duplicates the input 3x3 matrix.
- Parameters:
- {array} n
- The input matrix.
- Returns:
- {array} A new 9-component array r, where r[i] = m[i] (same as m.slice(0, 9)).
-
<static> {array} SpiderGL.Math.Mat3.identity()Creates an identity 3x3 matrix.
- Returns:
- {array} A new 9-component array representing an identity 3x3 matrix.
-
<static> {array} SpiderGL.Math.Mat3.mul2(m, v, z)Pre-multiplies a 2-dimensional vector by a column-major 3x3 matrix.
- Parameters:
- {array} m
- The input column-major 3x3 matrix.
- {array} v
- The input 2-dimensional vector.
- {number} z Optional, Default: 0
- The 3rd component of the input 2-dimensional vector.
- Returns:
- {array} A new 2-dimensional vector r, where r = m * v.
-
<static> {array} SpiderGL.Math.Mat3.mul3(m, v)Pre-multiplies a 3-dimensional vector by a column-major 3x3 matrix.
- Parameters:
- {array} m
- The input column-major 3x3 matrix.
- {array} v
- The input 3-dimensional vector.
- Returns:
- {array} A new 3-dimensional vector r, where r = m * v.
-
<static> {array} SpiderGL.Math.Mat3.one()Creates a 3x3 matrix initialized with one.
- Returns:
- {array} A new 9-component array r, where r[i] = 1.
-
<static> {array} SpiderGL.Math.Mat3.scalar(s)Creates a 3x3 matrix initialized with a scalar.
- Parameters:
- {number} s
- The input scalar.
- Returns:
- {array} A new 9-component array r, where r[i] = s.
-
<static> {array} SpiderGL.Math.Mat3.to44(m)Extends a 3x3 matrix to a 4x4 matrix.
- Parameters:
- {array} m
- The input matrix.
- Returns:
- {array} A new 16-component array representing a 4x4 matrix r, with the input 3x3 matrix as tue upper-left 3x3 region with [0, 0, 0, 1] as last row and column.
-
<static> {array} SpiderGL.Math.Mat3.transpose(m)Creates the transpose of a 3x3 matrix.
- Parameters:
- {array} m
- The input matrix.
- Returns:
- {array} A new 3x3 matrix representing the transpose of m.
-
<static> {array} SpiderGL.Math.Mat3.zero()Creates a 3x3 matrix initialized with zero.
- Returns:
- {array} A new 9-component array r, where r[i] = 0.