Matrix4

Matrix4

new Matrix4

A 4x4 matrix, indexable as a column-major order array. Constructor parameters are in row-major order for code readability.

Parameters:
Name Type Argument Default Description
column0Row0 Number <optional>
0.0 The value for column 0, row 0.
column1Row0 Number <optional>
0.0 The value for column 1, row 0.
column2Row0 Number <optional>
0.0 The value for column 2, row 0.
column3Row0 Number <optional>
0.0 The value for column 3, row 0.
column0Row1 Number <optional>
0.0 The value for column 0, row 1.
column1Row1 Number <optional>
0.0 The value for column 1, row 1.
column2Row1 Number <optional>
0.0 The value for column 2, row 1.
column3Row1 Number <optional>
0.0 The value for column 3, row 1.
column0Row2 Number <optional>
0.0 The value for column 0, row 2.
column1Row2 Number <optional>
0.0 The value for column 1, row 2.
column2Row2 Number <optional>
0.0 The value for column 2, row 2.
column3Row2 Number <optional>
0.0 The value for column 3, row 2.
column0Row3 Number <optional>
0.0 The value for column 0, row 3.
column1Row3 Number <optional>
0.0 The value for column 1, row 3.
column2Row3 Number <optional>
0.0 The value for column 2, row 3.
column3Row3 Number <optional>
0.0 The value for column 3, row 3.
See:

Members

<static> COLUMN0ROW0

The index into Matrix4 for column 0, row 0.

<static> COLUMN0ROW1

The index into Matrix4 for column 0, row 1.

<static> COLUMN0ROW2

The index into Matrix4 for column 0, row 2.

<static> COLUMN0ROW3

The index into Matrix4 for column 0, row 3.

<static> COLUMN1ROW0

The index into Matrix4 for column 1, row 0.

<static> COLUMN1ROW1

The index into Matrix4 for column 1, row 1.

<static> COLUMN1ROW2

The index into Matrix4 for column 1, row 2.

<static> COLUMN1ROW3

The index into Matrix4 for column 1, row 3.

<static> COLUMN2ROW0

The index into Matrix4 for column 2, row 0.

<static> COLUMN2ROW1

The index into Matrix4 for column 2, row 1.

<static> COLUMN2ROW2

The index into Matrix4 for column 2, row 2.

<static> COLUMN2ROW3

The index into Matrix4 for column 2, row 3.

<static> COLUMN3ROW0

The index into Matrix4 for column 3, row 0.

<static> COLUMN3ROW1

The index into Matrix4 for column 3, row 1.

<static> COLUMN3ROW2

The index into Matrix4 for column 3, row 2.

<static> COLUMN3ROW3

The index into Matrix4 for column 3, row 3.

<static> IDENTITY

An immutable Matrix4 instance initialized to the identity matrix.

Methods

clone

Duplicates the provided Matrix4 instance.

Parameters:
Name Type Argument Description
result Matrix4 <optional>
The object onto which to store the result.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

equals

Compares this matrix to the provided matrix componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
right Matrix4 <optional>
The right hand side matrix.
Returns:
Boolean true if they are equal, false otherwise.

equalsEpsilon

Compares this matrix to the provided matrix componentwise and returns true if they are within the provided epsilon, false otherwise.

Parameters:
Name Type Argument Description
right Matrix4 <optional>
The right hand side matrix.
epsilon Number The epsilon to use for equality testing.
Throws:
DeveloperError : epsilon is required and must be a number.
Returns:
Boolean true if they are within the provided epsilon, false otherwise.

getColumn

Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.

Parameters:
Name Type Argument Description
index Number The zero-based index of the column to retrieve.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : index is required and must be 0, 1, 2, or 3.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.
See:

getRotation

Gets the upper left 3x3 rotation matrix of this matrix, assuming the matrix is a affine transformation matrix.

Parameters:
Name Type Argument Description
result Matrix3 <optional>
The object onto which to store the result.
Returns:
Matrix3 The modified result parameter or a new Cartesian3 instance if one was not provided.
See:

getRow

Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.

Parameters:
Name Type Argument Description
index Number The zero-based index of the row to retrieve.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : index is required and must be 0, 1, 2, or 3.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.
See:

getTranslation

Gets the translation portion of this matrix, assuming the matrix is a affine transformation matrix.

Parameters:
Name Type Argument Description
result Cartesian3 <optional>
The object onto which to store the result.
Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided.
See:

inverse

Computes the inverse of this matrix using Cramers Rule. If the determinant is zero, the matrix can not be inverted, and an exception is thrown. If the matrix is an affine transformation matrix, it is more efficient to invert it with #inverseTransformation.

Parameters:
Name Type Argument Description
result Matrix4 <optional>
The object onto which to store the result.
Throws:
RuntimeError : matrix is not invertible because its determinate is zero.
Returns:
Matrix4 The modified result parameter or a new Cartesian3 instance if one was not provided.

inverseTransformation

Computes the inverse of this matrix assuming it is an affine transformation matrix, where the upper left 3x3 elements are a rotation matrix, and the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. The matrix is not verified to be in the proper form. This method is faster than computing the inverse for a general 4x4 matrix using #inverse.

Parameters:
Name Type Argument Description
result Matrix4 <optional>
The object onto which to store the result.
Returns:
Matrix4 The modified result parameter or a new Cartesian3 instance if one was not provided.

multiply

Computes the product of this matrix and the provided matrix.

Parameters:
Name Type Argument Description
right Matrix4 The right hand side matrix.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : right is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

multiplyByPoint

Computes the product of a matrix and a Cartesian3. This is equivalent to calling Matrix4#multiplyByVector with a Cartesian4 with a w component of one.

Parameters:
Name Type Argument Description
cartesian Cartesian3 The point.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : cartesian is required.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.

multiplyByScalar

Computes the product of this matrix and a scalar.

Parameters:
Name Type Argument Description
scalar Number The number to multiply by.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : scalar is required and must be a number.
Returns:
Matrix4 The modified result parameter or a new Cartesian4 instance if one was not provided.

multiplyByTranslation

Multiplies this matrix, assuming it is a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]), by an implicit translation matrix defined by a Cartesian3.

Parameters:
Name Type Argument Description
translation Cartesian3 The translation on the right-hand side of the multiplication.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : translation is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

multiplyByUniformScale

Multiplies this matrix, assuming it is a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]), by an implicit uniform scale matrix.

Parameters:
Name Type Argument Description
scale Number The scale on the right-hand side of the multiplication.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : scale is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

multiplyByVector

Computes the product of this matrix and a column vector.

Parameters:
Name Type Argument Description
cartesian Cartesian4 The vector.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : cartesian is required.
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.

negate

Computes a negated copy of this matrix.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to negate.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

setColumn

Computes a new matrix that replaces the specified column in this matrix with the provided Cartesian4 instance.

Parameters:
Name Type Description
index Number The zero-based index of the column to set.
cartesian Cartesian4 The Cartesian whose values will be assigned to the specified column.
Throws:
See:

setRow

Computes a new matrix that replaces the specified row in this matrix with the provided Cartesian4 instance.

Parameters:
Name Type Description
index Number The zero-based index of the row to set.
cartesian Cartesian4 The Cartesian whose values will be assigned to the specified row.
Throws:
See:

toArray

Computes an Array from this Matrix4 instance.

Parameters:
Name Type Argument Description
result Array <optional>
The Array onto which to store the result.
Returns:
Array The modified Array parameter or a new Array instance if one was not provided.

toString

Computes a string representing this Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.

Returns:
String A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.

transpose

Computes the transpose of this matrix.

Parameters:
Name Type Argument Description
result Matrix4 <optional>
The object onto which to store the result.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

<static> clone

Duplicates a Matrix4 instance.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to duplicate.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

<static> computeInfinitePerspectiveOffCenter

Computes a Matrix4 instance representing an infinite off center perspective transformation.

Parameters:
Name Type Argument Description
left Number The number of meters to the left of the camera that will be in view.
right Number The number of meters to the right of the camera that will be in view.
bottom Number The number of meters below of the camera that will be in view.
top Number The number of meters above of the camera that will be in view.
near Number The distance to the near plane in meters.
far Number The distance to the far plane in meters.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> computeOrthographicOffCenter

Computes a Matrix4 instance representing an orthographic transformation matrix.

Parameters:
Name Type Argument Description
left Number The number of meters to the left of the camera that will be in view.
right Number The number of meters to the right of the camera that will be in view.
bottom Number The number of meters below of the camera that will be in view.
top Number The number of meters above of the camera that will be in view.
near Number The distance to the near plane in meters.
far Number The distance to the far plane in meters.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> computePerspectiveFieldOfView

Computes a Matrix4 instance representing a perspective transformation matrix.

Parameters:
Name Type Argument Description
fovY Number The field of view along the Y axis in radians.
aspectRatio Number The aspect ratio.
near Number The distance to the near plane in meters.
far Number The distance to the far plane in meters.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> computePerspectiveOffCenter

Computes a Matrix4 instance representing an off center perspective transformation.

Parameters:
Name Type Argument Description
left Number The number of meters to the left of the camera that will be in view.
right Number The number of meters to the right of the camera that will be in view.
bottom Number The number of meters below of the camera that will be in view.
top Number The number of meters above of the camera that will be in view.
near Number The distance to the near plane in meters.
far Number The distance to the far plane in meters.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> computeViewportTransformation

Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.

Parameters:
Name Type Argument Default Description
viewport Object <optional>
{ x : 0.0, y : 0.0, width : 0.0, height : 0.0 } The viewport's corners as shown in Example 1.
nearDepthRange Number <optional>
0.0 The near plane distance in window coordinates.
farDepthRange Number <optional>
1.0 The far plane distance in window coordinates.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.
Example
// Example 1.  Create viewport transformation using an explicit viewport and depth range.
var m = Matrix4.computeViewportTransformation({
    x : 0.0,
    y : 0.0,
    width : 1024.0,
    height : 768.0
}, 0.0, 1.0);

// Example 2.  Create viewport transformation using the context's viewport.
var m = Matrix4.computeViewportTransformation(context.getViewport());
See:

<static> equals

Compares the provided matrices componentwise and returns true if they are equal, false otherwise.

Parameters:
Name Type Argument Description
left Matrix4 <optional>
The first matrix.
right Matrix4 <optional>
The second matrix.
Returns:
Boolean true if left and right are equal, false otherwise.

<static> equalsEpsilon

Compares the provided matrices componentwise and returns true if they are within the provided epsilon, false otherwise.

Parameters:
Name Type Argument Description
left Matrix4 <optional>
The first matrix.
right Matrix4 <optional>
The second matrix.
epsilon Number The epsilon to use for equality testing.
Throws:
DeveloperError : epsilon is required and must be a number.
Returns:
Boolean true if left and right are within the provided epsilon, false otherwise.

<static> fromCamera

Computes a Matrix4 instance from a Camera.

Parameters:
Name Type Argument Description
camera Camera The camera to use.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> fromColumnMajorArray

Computes a Matrix4 instance from a column-major order array.

Parameters:
Name Type Argument Description
values Array The column-major order array.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
DeveloperError : values is required.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> fromRotationTranslation

Computes a Matrix4 instance from a Matrix3 representing the rotation and a Cartesian3 representing the translation.

Parameters:
Name Type Argument Description
rotation Matrix3 The upper left portion of the matrix representing the rotation.
translation Cartesian3 The upper right portion of the matrix representing the translation.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> fromRowMajorArray

Computes a Matrix4 instance from a row-major order array. The resulting matrix will be in column-major order.

Parameters:
Name Type Argument Description
values Array The row-major order array.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
DeveloperError : values is required.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.

<static> fromScale

Computes a Matrix4 instance representing a non-uniform scale.

Parameters:
Name Type Argument Description
scale Cartesian3 The x, y, and z scale factors.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
DeveloperError : scale is required.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.
Example
// Creates
//   [7.0, 0.0, 0.0, 0.0]
//   [0.0, 8.0, 0.0, 0.0]
//   [0.0, 0.0, 9.0, 0.0]
//   [0.0, 0.0, 0.0, 1.0]
var m = Matrix4.fromScale(new Cartesian3(7.0, 8.0, 9.0));

<static> fromTranslation

Creates a Matrix4 instance from a Cartesian3 representing the translation.

Parameters:
Name Type Argument Description
translation Cartesian3 The upper right portion of the matrix representing the translation.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
DeveloperError : translation is required.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.
See:

<static> fromUniformScale

Computes a Matrix4 instance representing a uniform scale.

Parameters:
Name Type Argument Description
scale Number The uniform scale factor.
result Matrix4 <optional>
The object in which the result will be stored, if undefined a new instance will be created.
Throws:
DeveloperError : scale is required.
Returns:
The modified result parameter, or a new Matrix4 instance if one was not provided.
Example
// Creates
//   [2.0, 0.0, 0.0, 0.0]
//   [0.0, 2.0, 0.0, 0.0]
//   [0.0, 0.0, 2.0, 0.0]
//   [0.0, 0.0, 0.0, 1.0]
var m = Matrix4.fromScale(2.0);

<static> getColumn

Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
index Number The zero-based index of the column to retrieve.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.
See:

<static> getElementIndex

Computes the array index of the element at the provided row and column.

Parameters:
Name Type Description
row Number The zero-based index of the row.
column Number The zero-based index of the column.
Throws:
Returns:
Number The index of the element at the provided row and column.
Example
var myMatrix = new Matrix4();
var column1Row0Index = Matrix4.getElementIndex(1, 0);
var column1Row0 = myMatrix[column1Row0Index]
myMatrix[column1Row0Index] = 10.0;

<static> getRotation

Gets the upper left 3x3 rotation matrix of the provided matrix, assuming the matrix is a affine transformation matrix.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
result Matrix3 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix3 The modified result parameter or a new Cartesian3 instance if one was not provided.
See:

<static> getRow

Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
index Number The zero-based index of the row to retrieve.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.
See:

<static> getTranslation

Gets the translation portion of the provided matrix, assuming the matrix is a affine transformation matrix.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
result Cartesian3 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Cartesian3 The modified result parameter or a new Cartesian3 instance if one was not provided.
See:

<static> inverse

Computes the inverse of the provided matrix using Cramers Rule. If the determinant is zero, the matrix can not be inverted, and an exception is thrown. If the matrix is an affine transformation matrix, it is more efficient to invert it with #inverseTransformation.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to invert.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Cartesian3 instance if one was not provided.

<static> inverseTransformation

Computes the inverse of the provided matrix assuming it is an affine transformation matrix, where the upper left 3x3 elements are a rotation matrix, and the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1]. The matrix is not verified to be in the proper form. This method is faster than computing the inverse for a general 4x4 matrix using #inverse.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to invert.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix4 The modified result parameter or a new Cartesian3 instance if one was not provided.

<static> multiply

Computes the product of two matrices.

Parameters:
Name Type Argument Description
left Matrix4 The first matrix.
right Matrix4 The second matrix.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

<static> multiplyByPoint

Computes the product of a matrix and a Cartesian3. This is equivalent to calling Matrix4.multiplyByVector with a Cartesian4 with a w component of one.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix.
cartesian Cartesian3 The point.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.
Example
Cartesian3 p = new Cartesian3(1.0, 2.0, 3.0);
Matrix4.multiplyByPoint(matrix, p, result);
// A shortcut for
//   Cartesian3 p = ...
//   Matrix4.multiplyByVector(matrix, new Cartesian4(p.x, p.y, p.z, 1.0), result);

<static> multiplyByScalar

Computes the product of a matrix and a scalar.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix.
scalar Number The number to multiply by.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Cartesian4 instance if one was not provided.

<static> multiplyByTranslation

Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) by an implicit translation matrix defined by a Cartesian3. This is an optimization for Matrix4.multiply(m, Matrix4.fromTranslation(position), m); with less allocations and arithmetic operations.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix on the left-hand side.
translation Cartesian3 The translation on the right-hand side.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.
Example
// Instead of Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
Matrix4.multiplyByTranslation(m, position, m);
See:
  • Matrix4#fromTranslation

<static> multiplyByUniformScale

Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]) by an implicit uniform scale matrix. This is an optimization for Matrix4.multiply(m, Matrix4.fromScale(scale), m); with less allocations and arithmetic operations.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix on the left-hand side.
scale Number The uniform scale on the right-hand side.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.
Example
// Instead of Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
Matrix4.multiplyByUniformScale(m, scale, m);
See:
  • Matrix4#fromUniformScale

<static> multiplyByVector

Computes the product of a matrix and a column vector.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix.
cartesian Cartesian4 The vector.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Cartesian4 The modified result parameter or a new Cartesian4 instance if one was not provided.

<static> negate

Computes a negated copy of the provided matrix.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to negate.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.

<static> setColumn

Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
index Number The zero-based index of the column to set.
cartesian Cartesian4 The Cartesian whose values will be assigned to the specified column.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.
See:

<static> setRow

Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use.
index Number The zero-based index of the row to set.
cartesian Cartesian4 The Cartesian whose values will be assigned to the specified row.
result Cartesian4 <optional>
The object onto which to store the result.
Throws:
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.
See:

<static> toArray

Computes an Array from the provided Matrix4 instance. The array will be in column-major order.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to use..
result Array <optional>
The Array onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Array The modified Array parameter or a new Array instance if one was not provided.

<static> transpose

Computes the transpose of the provided matrix.

Parameters:
Name Type Argument Description
matrix Matrix4 The matrix to transpose.
result Matrix4 <optional>
The object onto which to store the result.
Throws:
DeveloperError : matrix is required.
Returns:
Matrix4 The modified result parameter or a new Matrix4 instance if one was not provided.