MatrixTests Transpose Method Delta Engine Documentation

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

public void Transpose()
Examples

[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