本文整理汇总了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))};
}
示例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);
}