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