setRow

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

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

//create a new Matrix4 instance with new row values from the Cartesian4 instance
// 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]

const a = Matrix4.setRow(m, 2, new Cartesian4(99.0, 98.0, 97.0, 96.0), new Matrix4());

// m remains the same
// a = [10.0, 11.0, 12.0, 13.0]
// [14.0, 15.0, 16.0, 17.0]
// [99.0, 98.0, 97.0, 96.0]
// [22.0, 23.0, 24.0, 25.0]

Return

The modified result parameter.

Parameters

matrix

The matrix to use.

index

The zero-based index of the row to set.

cartesian

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

result

The object onto which to store the result.

See also