本文整理汇总了C#中Matrix3x3.Inverse方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3x3.Inverse方法的具体用法?C# Matrix3x3.Inverse怎么用?C# Matrix3x3.Inverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3x3
的用法示例。
在下文中一共展示了Matrix3x3.Inverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Inverse
public void Test_Inverse()
{
var m = new Matrix3x3 (1, 2, 1,
1, 1, -1,
2, 1, 1);
var inversed = m.Inverse ();
var expected = new Matrix3x3 (-0.4f, 0.2f, 0.6f,
0.6f, 0.2f, -0.4f,
0.2f, -0.6f, 0.2f);
Assert.AreEqual (expected, inversed);
}
示例2: InverseTest
public void InverseTest(float v00, float v01, float v02, float v10, float v11, float v12, float v20, float v21, float v22)
{
Matrix3x3 matrix = new Matrix3x3();
matrix.V00 = v00;
matrix.V01 = v01;
matrix.V02 = v02;
matrix.V10 = v10;
matrix.V11 = v11;
matrix.V12 = v12;
matrix.V20 = v20;
matrix.V21 = v21;
matrix.V22 = v22;
Matrix3x3 inverse = matrix.Inverse();
Matrix3x3 identity = matrix * inverse;
Assert.AreEqual(true, ApproximateEquals(identity, Matrix3x3.Identity));
}