getColumn

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

Retrieves a copy of the matrix column 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: Creates an instance of Cartesian
const a = Matrix4.getColumn(m, 2, new Cartesian4());
//Example 2: Sets values for Cartesian instance
const a = new Cartesian4();
Matrix4.getColumn(m, 2, a);

// a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;

Return

The modified result parameter.

Parameters

matrix

The matrix to use.

index

The zero-based index of the column to retrieve.

result

The object onto which to store the result.

See also