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


C# Vector3D.Subtract方法代码示例

本文整理汇总了C#中Vector3D.Subtract方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.Subtract方法的具体用法?C# Vector3D.Subtract怎么用?C# Vector3D.Subtract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vector3D的用法示例。


在下文中一共展示了Vector3D.Subtract方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetVectorInNewBasis

 /// <summary>
 /// This method calculates the 2D coordinates in the new basis for a 3D point in the "old" kinect coordinate system</summary>
 /// This method must be used after calling the method "InitializeChangeOfBasis". Otherwise no new coordinate system is existing and this method will fail.
 /// <param name="pointInKinSpace">any 3D point which is located in the kinect space</param>
 /// <returns>Returns the calculated 2D point in the new coordinate system</returns>
 public static Vector2D GetVectorInNewBasis(Vector3D pointInKinSpace)
 {
     return new Vector2D{X = _e1Normed.ScalarProduct(pointInKinSpace.Subtract(_point2)),
                         Y = _e2Normed.ScalarProduct(pointInKinSpace.Subtract(_point2))};
 }
开发者ID:eluechin,项目名称:KinectAutoCalibration,代码行数:10,代码来源:ChangeOfBasis.cs

示例2: Subtract

        public void Subtract()
        {
            Vector3D v1 = new Vector3D(1.0, 2.0, 3.0);
            Vector3D v2 = new Vector3D(4.0, 5.0, 6.0);

            Vector3D v3 = v1 - v2;
            Assert.AreEqual(-3.0, v3.X, 1e-14);
            Assert.AreEqual(-3.0, v3.Y, 1e-14);
            Assert.AreEqual(-3.0, v3.Z, 1e-14);

            Vector3D v4 = v1.Subtract(v2);
            Assert.AreEqual(-3.0, v4.X, 1e-14);
            Assert.AreEqual(-3.0, v4.Y, 1e-14);
            Assert.AreEqual(-3.0, v4.Z, 1e-14);
        }
开发者ID:jpespartero,项目名称:OpenGlobe,代码行数:15,代码来源:Vector3DTests.cs


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