当前位置: 首页>>代码示例>>C#>>正文


C# Matrix3.Inverse方法代码示例

本文整理汇总了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);
        }
开发者ID:patricknboyd,项目名称:VectorMath,代码行数:15,代码来源:Matrix3_Test.cs

示例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();
    }
开发者ID:annsofi,项目名称:SakerSomFaller,代码行数:22,代码来源:Class1.cs

示例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();
        }
开发者ID:patricknboyd,项目名称:VectorMath,代码行数:11,代码来源:Matrix3_Test.cs


注:本文中的Matrix3.Inverse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。