本文整理汇总了C#中Sphere.GetNormalAtPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Sphere.GetNormalAtPoint方法的具体用法?C# Sphere.GetNormalAtPoint怎么用?C# Sphere.GetNormalAtPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sphere
的用法示例。
在下文中一共展示了Sphere.GetNormalAtPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sphere_GetNormalAtPoint_returns_vector_in_correct_direction
public void Sphere_GetNormalAtPoint_returns_vector_in_correct_direction()
{
var centre = new Point(50.0f, -12.0f, 4.2f);
var radius = 10.0f;
var s = new Sphere(centre, radius);
var actual = s.GetNormalAtPoint(new Point(60.0f, -12.0f, 4.2f));
Assert.AreEqual(new Vector(1.0f, 0.0f, 0.0f), actual);
}
示例2: Sphere_GetNormalAtPoint_returns_normalised_vector
public void Sphere_GetNormalAtPoint_returns_normalised_vector()
{
var centre = new Point(50.0f, -12.0f, 4.2f);
var radius = 10.0f;
var s = new Sphere(centre, radius);
var actual = s.GetNormalAtPoint(new Point(60.0f, -12.0f, 4.2f));
Assert.AreEqual(1.0f, actual.Norm(), EPSILON);
}