Matrix Transpose Method Delta Engine Documentation

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public static Matrix Transpose(
	Matrix matrix
)

Return Value

Type: Matrix
Remarks

Tests: DeltaEngine.Tests.Datatypes.MatrixTests
Examples

3 unit tests call DeltaEngine.Datatypes.Matrix.Transpose(DeltaEngine.Datatypes.Matrix)
[Test]
public void Transpose()
{
    var expected = new Matrix(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
    Assert.AreEqual(expected, Matrix.Transpose(matrix));
}
[Test]
public void TransposingTwiceReturnsTheOriginal()
{
    Assert.AreEqual(matrix, Matrix.Transpose(Matrix.Transpose(matrix)));
}
[Test]
public void InvertTranspose()
{
    var source = new Matrix(-4, 0, 0, 0, -1, 2, 0, 0, -4, 4, 4, 0, -1, -9, -1, 1);
    var expected1 = new Matrix(-0.25f, -0.125f, -0.125f, -1.5f, 0, 0.5f, -0.5f, 4, 0, 0, 0.25f,
        0.25f, 0, 0, 0, 1);
    Assert.IsTrue(Matrix.InverseTranspose(source).IsNearlyEqual(expected1));
}
See Also