getRow

fun getRow(matrix: Matrix4, index: Int, result: Cartesian4): Cartesian4(source)

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

//returns a Cartesian4 instance with values from the specified column
// m = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [18.0, 19.0, 20.0, 21.0]
// [22.0, 23.0, 24.0, 25.0]

//Example 1: Returns an instance of Cartesian
const a = Matrix4.getRow(m, 2, new Cartesian4());
//Example 2: Sets values for a Cartesian instance
const a = new Cartesian4();
Matrix4.getRow(m, 2, a);

// a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;

Return

The modified result parameter.

Parameters

matrix

The matrix to use.

index

The zero-based index of the row to retrieve.

result

The object onto which to store the result.

See also