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


C# Line.IntersectsLine方法代码示例

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


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

示例1: Line_DoesIntersectLine

        public void Line_DoesIntersectLine()
        {
            Line line1 = new Line(Point.MakePointWithInches(0, 0), Point.MakePointWithInches(0, 5));
            Line line2 = new Line(Point.MakePointWithInches(5, 0), Point.MakePointWithInches(-3, 0));
            Line line3 = new Line(Point.MakePointWithInches(3, 3, 0), Point.MakePointWithInches(-3, -3, 2));
            Line line4 = new Line(Point.MakePointWithInches(3, -3, 0), Point.MakePointWithInches(-3, 3, 2));

            bool resultT1 = line1.IntersectsLine(line2);
            bool resultF1 = line2.IntersectsLine(line3);
            bool resultT2 = line3.IntersectsLine(line4);

            resultT1.Should().BeTrue();
            resultF1.Should().BeFalse();
            resultT2.Should().BeTrue();
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:15,代码来源:LineTests.cs

示例2: Line_WillTwoLinesOnTopOfOneAnotherIntersectTest

        public void Line_WillTwoLinesOnTopOfOneAnotherIntersectTest()
        {

            Line line1 = new Line(Point.Origin, Point.MakePointWithInches(10, 0, 0));
            Line line2 = new Line(Point.MakePointWithInches(3, 0, 0), Point.MakePointWithInches(6, 0, 0));
            Line line3 = new Line(Point.MakePointWithInches(3, 2, 0), Point.MakePointWithInches(-2, 5, 3));
            Line line4 = new Line(Point.MakePointWithInches(3, 5, 0), Point.MakePointWithInches(-2, 2, 3));
            Line line5 = new Line(Point.MakePointWithInches(0, 5), Point.MakePointWithInches(0, -3));
            Line line6 = new Line(Point.MakePointWithInches(0, 2), Point.MakePointWithInches(0, -1));

            bool resultT1 = line1.IntersectsLine(line2);
            bool resultT2 = line3.IntersectsLine(line4);
            bool resultT3 = line5.IntersectsLine(line6);
            bool resultF1 = line1.IntersectsLine(line3);

            resultT1.Should().BeTrue();
            resultT2.Should().BeTrue();
            resultT3.Should().BeTrue();
            resultF1.Should().BeFalse();
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:20,代码来源:LineTests.cs


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