本文整理汇总了C#中Vector3D.GetAngleBetween方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.GetAngleBetween方法的具体用法?C# Vector3D.GetAngleBetween怎么用?C# Vector3D.GetAngleBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3D
的用法示例。
在下文中一共展示了Vector3D.GetAngleBetween方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAngleBetween
public void TestAngleBetween()
{
const float halfPi = (float)Math.PI/2;
const float tolerance = 1e-5F;
var v1 = Vector3D.xUnit;
var v2 = Vector3D.yUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v2 = -Vector3D.yUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v2 = Vector3D.zUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v2 = -Vector3D.zUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v1 = Vector3D.yUnit;
v2 = Vector3D.zUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v2 = -Vector3D.zUnit;
Assert.AreEqual(halfPi, v1.GetAngleBetween(v2), tolerance);
v1 = new Vector3D(2.2F, -6.1F, 7.4F);
v2 = new Vector3D(3.8F, 3.7F, 4.1F);
const float result = 1.32374F; //75.845 degrees.
Assert.AreEqual(result, v1.GetAngleBetween(v2), tolerance);
v1 = v2 = Vector3D.xUnit;
Assert.AreEqual(0, v1.GetAngleBetween(v2), tolerance);
}