Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Matrix3
    • Matrix3

Index

Constructors

constructor

  • new Matrix3(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number): Matrix3
  • Parameters

    • Optional column0Row0: number
    • Optional column1Row0: number
    • Optional column2Row0: number
    • Optional column0Row1: number
    • Optional column1Row1: number
    • Optional column2Row1: number
    • Optional column0Row2: number
    • Optional column1Row2: number
    • Optional column2Row2: number

    Returns Matrix3

Properties

length

length: number

Gets the number of items in the collection.

Static Readonly COLUMN0ROW0

COLUMN0ROW0: number

The index into Matrix3 for column 0, row 0.

Static Readonly COLUMN0ROW1

COLUMN0ROW1: number

The index into Matrix3 for column 0, row 1.

Static Readonly COLUMN0ROW2

COLUMN0ROW2: number

The index into Matrix3 for column 0, row 2.

Static Readonly COLUMN1ROW0

COLUMN1ROW0: number

The index into Matrix3 for column 1, row 0.

Static Readonly COLUMN1ROW1

COLUMN1ROW1: number

The index into Matrix3 for column 1, row 1.

Static Readonly COLUMN1ROW2

COLUMN1ROW2: number

The index into Matrix3 for column 1, row 2.

Static Readonly COLUMN2ROW0

COLUMN2ROW0: number

The index into Matrix3 for column 2, row 0.

Static Readonly COLUMN2ROW1

COLUMN2ROW1: number

The index into Matrix3 for column 2, row 1.

Static Readonly COLUMN2ROW2

COLUMN2ROW2: number

The index into Matrix3 for column 2, row 2.

Static Readonly IDENTITY

IDENTITY: Matrix3

An immutable Matrix3 instance initialized to the identity matrix.

Static Readonly ZERO

ZERO: Matrix3

An immutable Matrix3 instance initialized to the zero matrix.

Static packedLength

packedLength: number

The number of elements used to pack the object into an array.

Methods

clone

  • clone(result?: Matrix3): Matrix3
  • Duplicates the provided Matrix3 instance.

    Parameters

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter or a new Matrix3 instance if one was not provided.

equals

  • equals(right?: Matrix3): boolean
  • Compares this matrix to the provided matrix componentwise and returns true if they are equal, false otherwise.

    Parameters

    • Optional right: Matrix3

    Returns boolean

    true if they are equal, false otherwise.

equalsEpsilon

  • equalsEpsilon(right?: Matrix3, epsilon?: number): boolean
  • Compares this matrix to the provided matrix componentwise and returns true if they are within the provided epsilon, false otherwise.

    Parameters

    • Optional right: Matrix3
    • Optional epsilon: number

    Returns boolean

    true if they are within the provided epsilon, false otherwise.

toString

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

    Returns string

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

Static abs

  • abs(matrix: Matrix3, result: Matrix3): Matrix3
  • Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.

    Parameters

    • matrix: Matrix3

      The matrix with signed elements.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static add

  • add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3
  • Computes the sum of two matrices.

    Parameters

    • left: Matrix3

      The first matrix.

    • right: Matrix3

      The second matrix.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static clone

  • clone(matrix: Matrix3, result?: Matrix3): Matrix3
  • Duplicates a Matrix3 instance.

    Parameters

    • matrix: Matrix3

      The matrix to duplicate.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)

Static computeEigenDecomposition

  • computeEigenDecomposition(matrix: Matrix3, result?: any): any
  • Computes the eigenvectors and eigenvalues of a symmetric matrix.

    Returns a diagonal matrix and unitary matrix such that: matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)

    The values along the diagonal of the diagonal matrix are the eigenvalues. The columns of the unitary matrix are the corresponding eigenvectors.

    example

    var a = //... symetric matrix var result = { unitary : new Cesium.Matrix3(), diagonal : new Cesium.Matrix3() }; Cesium.Matrix3.computeEigenDecomposition(a, result);

    var unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3()); var b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3()); Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a

    var lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue var v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector var c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)

    Parameters

    • matrix: Matrix3

      The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.

    • Optional result: any

    Returns any

    An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.

Static determinant

  • determinant(matrix: Matrix3): number
  • Computes the determinant of the provided matrix.

    Parameters

    • matrix: Matrix3

      The matrix to use.

    Returns number

    The value of the determinant of the matrix.

Static divideByScale

Static equals

  • equals(left?: Matrix3, right?: Matrix3): boolean
  • Compares the provided matrices componentwise and returns true if they are equal, false otherwise.

    Parameters

    • Optional left: Matrix3
    • Optional right: Matrix3

    Returns boolean

    true if left and right are equal, false otherwise.

Static equalsEpsilon

  • equalsEpsilon(left?: Matrix3, right?: Matrix3, epsilon?: number): boolean
  • Compares the provided matrices componentwise and returns true if they are within the provided epsilon, false otherwise.

    Parameters

    • Optional left: Matrix3
    • Optional right: Matrix3
    • Optional epsilon: number

    Returns boolean

    true if left and right are within the provided epsilon, false otherwise.

Static fromArray

Static fromColumnMajorArray

  • fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3
  • Creates a Matrix3 instance from a column-major order array.

    Parameters

    • values: number[]

      The column-major order array.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromCrossProduct

  • fromCrossProduct(vector: Cartesian3, result?: Matrix3): Matrix3
  • Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.

    example

    // Creates // [0.0, -9.0, 8.0] // [9.0, 0.0, -7.0] // [-8.0, 7.0, 0.0] var m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));

    Parameters

    • vector: Cartesian3

      the vector on the left hand side of the cross product operation.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromHeadingPitchRoll

  • fromHeadingPitchRoll(headingPitchRoll: HeadingPitchRoll, result?: Matrix3): Matrix3

Static fromQuaternion

  • fromQuaternion(quaternion: Quaternion, result?: Matrix3): Matrix3
  • Computes a 3x3 rotation matrix from the provided quaternion.

    Parameters

    • quaternion: Quaternion

      the quaternion to use.

    • Optional result: Matrix3

    Returns Matrix3

    The 3x3 rotation matrix from this quaternion.

Static fromRotationX

  • fromRotationX(angle: number, result?: Matrix3): Matrix3
  • Creates a rotation matrix around the x-axis.

    example

    // Rotate a point 45 degrees counterclockwise around the x-axis. var p = new Cesium.Cartesian3(5, 6, 7); var m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0)); var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());

    Parameters

    • angle: number

      The angle, in radians, of the rotation. Positive angles are counterclockwise.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromRotationY

  • fromRotationY(angle: number, result?: Matrix3): Matrix3
  • Creates a rotation matrix around the y-axis.

    example

    // Rotate a point 45 degrees counterclockwise around the y-axis. var p = new Cesium.Cartesian3(5, 6, 7); var m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0)); var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());

    Parameters

    • angle: number

      The angle, in radians, of the rotation. Positive angles are counterclockwise.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromRotationZ

  • fromRotationZ(angle: number, result?: Matrix3): Matrix3
  • Creates a rotation matrix around the z-axis.

    example

    // Rotate a point 45 degrees counterclockwise around the z-axis. var p = new Cesium.Cartesian3(5, 6, 7); var m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0)); var rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());

    Parameters

    • angle: number

      The angle, in radians, of the rotation. Positive angles are counterclockwise.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromRowMajorArray

  • fromRowMajorArray(values: number[], result?: Matrix3): Matrix3
  • Creates a Matrix3 instance from a row-major order array. The resulting matrix will be in column-major order.

    Parameters

    • values: number[]

      The row-major order array.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromScale

  • fromScale(scale: Cartesian3, result?: Matrix3): Matrix3
  • Computes a Matrix3 instance representing a non-uniform scale.

    example

    // Creates // [7.0, 0.0, 0.0] // [0.0, 8.0, 0.0] // [0.0, 0.0, 9.0] var m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));

    Parameters

    • scale: Cartesian3

      The x, y, and z scale factors.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static fromUniformScale

  • fromUniformScale(scale: number, result?: Matrix3): Matrix3
  • Computes a Matrix3 instance representing a uniform scale.

    example

    // Creates // [2.0, 0.0, 0.0] // [0.0, 2.0, 0.0] // [0.0, 0.0, 2.0] var m = Cesium.Matrix3.fromUniformScale(2.0);

    Parameters

    • scale: number

      The uniform scale factor.

    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter, or a new Matrix3 instance if one was not provided.

Static getColumn

  • getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3
  • Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.

    Parameters

    • matrix: Matrix3

      The matrix to use.

    • index: number

      The zero-based index of the column to retrieve.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static getElementIndex

  • getElementIndex(row: number, column: number): number
  • Computes the array index of the element at the provided row and column.

    example

    var myMatrix = new Cesium.Matrix3(); var column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0); var column1Row0 = myMatrix[column1Row0Index] myMatrix[column1Row0Index] = 10.0;

    Parameters

    • row: number

      The zero-based index of the row.

    • column: number

      The zero-based index of the column.

    Returns number

    The index of the element at the provided row and column.

Static getMaximumScale

  • getMaximumScale(matrix: Matrix3): number
  • Computes the maximum scale assuming the matrix is an affine transformation. The maximum scale is the maximum length of the column vectors.

    Parameters

    • matrix: Matrix3

      The matrix.

    Returns number

    The maximum scale.

Static getRotation

  • getRotation(matrix: Matrix3, result: Matrix3): Matrix3
  • Extracts the rotation assuming the matrix is an affine transformation.

    Parameters

    • matrix: Matrix3

      The matrix.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter

Static getRow

  • getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3
  • Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.

    Parameters

    • matrix: Matrix3

      The matrix to use.

    • index: number

      The zero-based index of the row to retrieve.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static getScale

  • getScale(matrix: Matrix3, result: Cartesian3): Cartesian3
  • Extracts the non-uniform scale assuming the matrix is an affine transformation.

    Parameters

    • matrix: Matrix3

      The matrix.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static inverse

  • inverse(matrix: Matrix3, result: Matrix3): Matrix3
  • Computes the inverse of the provided matrix.

    Parameters

    • matrix: Matrix3

      The matrix to invert.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static multiply

  • multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3
  • Computes the product of two matrices.

    Parameters

    • left: Matrix3

      The first matrix.

    • right: Matrix3

      The second matrix.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static multiplyByScalar

  • multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3
  • Computes the product of a matrix and a scalar.

    Parameters

    • matrix: Matrix3

      The matrix.

    • scalar: number

      The number to multiply by.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static multiplyByScale

  • multiplyByScale(matrix: Matrix3, scale: Cartesian3, result: Matrix3): Matrix3
  • Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.

    example

    // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m); Cesium.Matrix3.multiplyByScale(m, scale, m);

    Parameters

    • matrix: Matrix3

      The matrix on the left-hand side.

    • scale: Cartesian3

      The non-uniform scale on the right-hand side.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static multiplyByVector

  • multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the product of a matrix and a column vector.

    Parameters

    • matrix: Matrix3

      The matrix.

    • cartesian: Cartesian3

      The column.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static negate

  • negate(matrix: Matrix3, result: Matrix3): Matrix3
  • Creates a negated copy of the provided matrix.

    Parameters

    • matrix: Matrix3

      The matrix to negate.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static pack

  • pack(value: Matrix3, array: number[], startingIndex?: number): number[]
  • Stores the provided instance into the provided array.

    Parameters

    • value: Matrix3

      The value to pack.

    • array: number[]

      The array to pack into.

    • Optional startingIndex: number

    Returns number[]

    The array that was packed into

Static setColumn

  • setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3
  • Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.

    Parameters

    • matrix: Matrix3

      The matrix to use.

    • index: number

      The zero-based index of the column to set.

    • cartesian: Cartesian3

      The Cartesian whose values will be assigned to the specified column.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static setRow

  • setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Matrix3): Matrix3
  • Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.

    Parameters

    • matrix: Matrix3

      The matrix to use.

    • index: number

      The zero-based index of the row to set.

    • cartesian: Cartesian3

      The Cartesian whose values will be assigned to the specified row.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static subtract

  • subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3
  • Computes the difference of two matrices.

    Parameters

    • left: Matrix3

      The first matrix.

    • right: Matrix3

      The second matrix.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static toArray

  • toArray(matrix: Matrix3, result?: number[]): number[]
  • Creates an Array from the provided Matrix3 instance. The array will be in column-major order.

    Parameters

    • matrix: Matrix3

      The matrix to use..

    • Optional result: number[]

    Returns number[]

    The modified Array parameter or a new Array instance if one was not provided.

Static transpose

  • transpose(matrix: Matrix3, result: Matrix3): Matrix3
  • Computes the transpose of the provided matrix.

    Parameters

    • matrix: Matrix3

      The matrix to transpose.

    • result: Matrix3

      The object onto which to store the result.

    Returns Matrix3

    The modified result parameter.

Static unpack

  • unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3
  • Retrieves an instance from a packed array.

    Parameters

    • array: number[]

      The packed array.

    • Optional startingIndex: number
    • Optional result: Matrix3

    Returns Matrix3

    The modified result parameter or a new Matrix3 instance if one was not provided.