本文整理汇总了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);
}
示例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();
}
示例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));
}
示例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));
}
示例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();
}