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


C# Location.angle_between方法代码示例

本文整理汇总了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));
        }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:9,代码来源:location_test.cs

示例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));
        }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:9,代码来源:location_test.cs

示例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);
        }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:18,代码来源:location_test.cs

示例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));
 }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:8,代码来源:location_test.cs

示例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));
        }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:9,代码来源:location_test.cs

示例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));
        }
开发者ID:iamjwc,项目名称:fightin-zigbees,代码行数:9,代码来源:location_test.cs


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