本文整理汇总了C#中Matrix3.Inverse方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3.Inverse方法的具体用法?C# Matrix3.Inverse怎么用?C# Matrix3.Inverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3
的用法示例。
在下文中一共展示了Matrix3.Inverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InversionTest_Success
public void InversionTest_Success()
{
Matrix3 mat = new Matrix3(new double[,]
{
{ -2.0, 2.0, -3.0 },
{ -1.0, 1.0, 3.0 },
{ 2.0, 0.0, -1.0 }
});
Matrix3 inverse = mat.Inverse();
Matrix3 product = mat * inverse;
Assert.AreEqual(Matrix3.Identity, product);
}
示例2: calculateInertiaTensorInverse
public void calculateInertiaTensorInverse(ref physicsMesh physMesh)
{
Matrix3 Ibody = new Matrix3();
for (int i = 0; i < physMesh.polygonArray.Length; i++)
{
//Console.WriteLine("i: " + physMesh.polygonArray[i].mass);
Ibody.M11 = Ibody.M11 + physMesh.polygonArray[i].mass * ((float)Math.Pow(physMesh.polygonArray[i].centerOfMass.Y, 2.0) + (float)Math.Pow(physMesh.polygonArray[i].centerOfMass.Z, 2.0));
Ibody.M12 = Ibody.M12 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.X) * (physMesh.polygonArray[i].centerOfMass.Y));
Ibody.M13 = Ibody.M13 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.X) * (physMesh.polygonArray[i].centerOfMass.Z));
Ibody.M21 = Ibody.M21 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.X) * (physMesh.polygonArray[i].centerOfMass.Y));
Ibody.M22 = Ibody.M22 + physMesh.polygonArray[i].mass * ((float)Math.Pow(physMesh.polygonArray[i].centerOfMass.X, 2.0) + (float)Math.Pow(physMesh.polygonArray[i].centerOfMass.Z, 2.0));
Ibody.M23 = Ibody.M23 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.Y) * (physMesh.polygonArray[i].centerOfMass.Z));
Ibody.M31 = Ibody.M31 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.X) * (physMesh.polygonArray[i].centerOfMass.Z));
Ibody.M32 = Ibody.M32 + physMesh.polygonArray[i].mass * -1 * ((physMesh.polygonArray[i].centerOfMass.Y) * (physMesh.polygonArray[i].centerOfMass.Y));
Ibody.M33 = Ibody.M33 + physMesh.polygonArray[i].mass * ((float)Math.Pow(physMesh.polygonArray[i].centerOfMass.X, 2.0) + (float)Math.Pow(physMesh.polygonArray[i].centerOfMass.Y, 2.0));
}
physMesh.inertiaTensorInverse = Ibody.Inverse();
}
示例3: InversionTest_NonInvertible_Throws
public void InversionTest_NonInvertible_Throws()
{
Matrix3 mat = new Matrix3(new double[,]
{
{ -2.0, 2.0, -3.0 },
{ 0.0, 0.0, 0.0 },
{ 2.0, 0.0, -1.0 }
});
mat.Inverse();
}