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


C# Line.IntersectWithLine方法代码示例

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


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

示例1: Line_Intersection_Millimeters

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

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

            Point expectedResult = Point.MakePointWithMillimeters(0, 2.5, 1.5);
            Point actualResult = line1.IntersectWithLine(line2);

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

示例2: Line_IntersectionTest_Perpendicular2

        public void Line_IntersectionTest_Perpendicular2()
        {
            Point basePointLine1 = Point.MakePointWithInches(1, 1, 2);
            Point basePointLine2 = Point.MakePointWithInches(1, 1, 2);

            Line line1 = new Line(basePointLine1, Point.MakePointWithInches(1, 7, 2));
            Line line2 = new Line(basePointLine2, Point.MakePointWithInches(1, 1, 6));

            Point expectedResult = Point.MakePointWithInches(1, 1, 2);
            Point actualResult = line1.IntersectWithLine(line2);

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

示例3: LineSegment_IntersectWithLine_ShouldBeLineIntersection_IfLineSegmentEndPointIsOnLine

        public void LineSegment_IntersectWithLine_ShouldBeLineIntersection_IfLineSegmentEndPointIsOnLine()
        {
            LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1));
            Line line = new Line(Point.MakePointWithInches(0, 0, 1), Point.MakePointWithInches(0, 0, 2));

            Line lineSegmentToLine = new Line(lineSegment);

            lineSegment.IntersectWithLine(line).Should().Be(lineSegmentToLine.IntersectWithLine(line));
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:9,代码来源:LineSegmentTests.cs

示例4: LineSegment_IntersectWithLine_ShouldEqualLineIntersect

        public void LineSegment_IntersectWithLine_ShouldEqualLineIntersect()
        {
            LineSegment lineSegment = new LineSegment(Point.MakePointWithInches(1, 1, 1));
            Line line = new Line(Point.MakePointWithInches(0, 0, 1), Point.MakePointWithInches(1, 1, 0));

            Line lineSegmentToLine = new Line(lineSegment);

            lineSegment.IntersectWithLine(line).Should().Be(lineSegmentToLine.IntersectWithLine(line));
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:9,代码来源:LineSegmentTests.cs

示例5: Line_Intersection_Origin

        public void Line_Intersection_Origin()
        {
            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));

            Point expectedResult = Point.Origin;
            Point actualResult = line1.IntersectWithLine(line2);

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


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