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


C# Line.SmallestAngleBetween方法代码示例

本文整理汇总了C#中Line.SmallestAngleBetween方法的典型用法代码示例。如果您正苦于以下问题:C# Line.SmallestAngleBetween方法的具体用法?C# Line.SmallestAngleBetween怎么用?C# Line.SmallestAngleBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Line的用法示例。


在下文中一共展示了Line.SmallestAngleBetween方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Line_SmallestAngleBetween_IntersectAtOrigin

        public void Line_SmallestAngleBetween_IntersectAtOrigin()
        {
            Point basePointLine1 = Point.Origin;
            Point basePointLine2 = Point.Origin;

            Line line1 = new Line(basePointLine1, Point.MakePointWithInches(1, 1, 1));
            Line line2 = new Line(basePointLine2, Point.MakePointWithInches(0, 0, 1));

            double angleBetweenLinesInRadians = Math.Acos(1 / Math.Sqrt(3));
            Angle angleBetweenLines = new Angle(new Radian(), angleBetweenLinesInRadians);

            line1.SmallestAngleBetween(line2).Should().Be(angleBetweenLines);
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:13,代码来源:LineTests.cs

示例2: Line_SmallestAngleBetween_Perpendicular

        public void Line_SmallestAngleBetween_Perpendicular()
        {
            Point basePointLine1 = Point.Origin;
            Point basePointLine2 = Point.Origin;

            Line line1 = new Line(basePointLine1, Point.MakePointWithInches(1, 0, 0));
            Line line2 = new Line(basePointLine2, Point.MakePointWithInches(0, 0, 1));

            double angleBetweenLinesInRadians = Math.Acos(0);
            Angle angleBetweenLines = new Angle(new Radian(), angleBetweenLinesInRadians);

            line1.SmallestAngleBetween(line2).Should().Be(angleBetweenLines);

        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:14,代码来源:LineTests.cs

示例3: Line_SmallestAngleBetween_Millimeters

        public void Line_SmallestAngleBetween_Millimeters()
        {
            Point basePointLine1 = Point.MakePointWithInches(2, 1, 0);
            Point basePointLine2 = Point.MakePointWithInches(2, 4, 0);

            Line line1 = new Line(basePointLine1, Point.MakePointWithInches(-2, 4, 3));
            Line line2 = new Line(basePointLine2, Point.MakePointWithInches(-2, 1, 3));

            Angle expectedResult = new Angle(new Radian(), 1.080839);
            Angle actualResult = line1.SmallestAngleBetween(line2);

            actualResult.Should().Be(expectedResult);
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:13,代码来源:LineTests.cs


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