transpose

fun transpose(matrix: Matrix4, result: Matrix4): Matrix4(source)

Computes the transpose of the provided matrix.

//returns transpose of a Matrix4
// 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.transpose(m, new Matrix4());

// m remains the same
// a = [10.0, 14.0, 18.0, 22.0]
// [11.0, 15.0, 19.0, 23.0]
// [12.0, 16.0, 20.0, 24.0]
// [13.0, 17.0, 21.0, 25.0]

Return

The modified result parameter.

Parameters

matrix

The matrix to transpose.

result

The object onto which to store the result.

See also