本文整理汇总了C#中Location.angle_between方法的典型用法代码示例。如果您正苦于以下问题:C# Location.angle_between方法的具体用法?C# Location.angle_between怎么用?C# Location.angle_between使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location.angle_between方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: two_hundred_and_twenth_five_degree_from_origin_spec
public void two_hundred_and_twenth_five_degree_from_origin_spec()
{
Location l0 = new Location(0, 0);
Location quadrant2 = new Location(-5, 5);
Location quadrant1 = new Location(5, 0);
float angle = l0.angle_between(quadrant2, quadrant1);
Specify.That(Math.Round(angle, 5)).ShouldEqual(Math.Round((5 * Math.PI) / 4, 5));
}
示例2: two_hundred_and_seventy_degree_spec
public void two_hundred_and_seventy_degree_spec()
{
Location l0 = new Location(10, 10);
Location l1 = new Location(5, 15);
Location l2 = new Location(15, 15);
float angle = l0.angle_between(l1, l2);
Specify.That(Math.Round(angle, 5)).ShouldEqual(Math.Round((3 * Math.PI) / 2, 5));
}
示例3: two_angles_per_quadrant_test
public void two_angles_per_quadrant_test()
{
Location l0 = new Location(0, 0);
Location quadrant1 = new Location(1, 0);
Location loc;
loc = new Location(-2, -1);
Specify.That(Math.Round(l0.angle_between(quadrant1, loc), 5)).ShouldEqual(3.60524);
loc = new Location(-1, -2);
Specify.That(Math.Round(l0.angle_between(quadrant1, loc), 5)).ShouldEqual(4.24874);
loc = new Location(1, -2);
Specify.That(Math.Round(l0.angle_between(quadrant1, loc), 5)).ShouldEqual(5.17604);
loc = new Location(2, -1);
Specify.That(Math.Round(l0.angle_between(quadrant1, loc), 5)).ShouldEqual(5.81954);
}
示例4: simple_fourty_five_degree_spec
public void simple_fourty_five_degree_spec()
{
Location l0 = new Location(0, 0);
Location l1 = new Location(5, 0);
Location l2 = new Location(5, 5);
float angle = l0.angle_between(l1, l2);
Specify.That(Math.Round(angle, 5)).ShouldEqual(Math.Round(Math.PI / 4, 5));
}
示例5: one_hundered_and_eighty_degree_from_origin_spec
public void one_hundered_and_eighty_degree_from_origin_spec()
{
Location l0 = new Location(0, 0);
Location l1 = new Location(5, 0);
Location l2 = new Location(-5, 0);
float angle = l0.angle_between(l1, l2);
Specify.That(Math.Round(angle, 5)).ShouldEqual(Math.Round(Math.PI, 5));
}
示例6: ninety_degree_from_origin_spec
public void ninety_degree_from_origin_spec()
{
Location l0 = new Location(0, 0);
Location quadrant2 = new Location(-5, 5);
Location quadrant1 = new Location(5, 5);
float angle = l0.angle_between(quadrant1, quadrant2);
Specify.That(Math.Round(angle, 5)).ShouldEqual(Math.Round(Math.PI / 2, 5));
}