public void IntersectionTest() { var line1 = new KtSegment2D(-1, 2, -.5, 3); var line2 = new KtSegment2D(1, 2, .5, 3); var line3 = new KtSegment2D(1, 2, -1, 3); Assert.AreEqual(line2.IntersectionWith(line1), null); Assert.IsFalse(line1.HasIntersection(line2)); Assert.AreEqual(line3.IntersectionWith(line1), new KtPoint2D(-0.6, 2.8)); Assert.IsTrue(line1.HasIntersection(line3)); }
public void TestIntersectionCheckSpeedA() { var line1 = new KtSegment2D(-1, 2, -.5, 3); var line2 = new KtSegment2D(1, 2, -1, 3); for (int i = 0; i < testIteration; i++) { Assert.IsTrue(line1.HasIntersection(line2)); } }