public void intersection_identical() { var a = new Ray2(new Point2(0, 0), new Point2(1, 1)); var b = new Ray2(new Point2(0, 0), new Point2(1, 1)); Assert.Equal(a, a.Intersection(a)); Assert.Equal(b, a.Intersection(a)); Assert.Equal(a, b.Intersection(b)); Assert.Equal(b, b.Intersection(b)); Assert.Equal(a, a.Intersection(b)); Assert.Equal(b, a.Intersection(b)); Assert.Equal(a, b.Intersection(a)); Assert.Equal(b, b.Intersection(a)); }
public static void segment_ray_intersection_result() { var a1 = new Segment2(A, B); var a2 = new Segment2(B, A); var b = new Ray2(C, D); var forward1 = a1.Intersection(b); var forward2 = a2.Intersection(b); var reverse1 = b.Intersection(a1); var reverse2 = b.Intersection(a2); forward1.Should().NotBeNull(); forward1.Should().Be(forward2); forward1.Should().Be(reverse1); forward1.Should().Be(reverse2); }
public static void line_ray_intersection_result() { var a1 = new Line2(A, B); var a2 = new Line2(B, A); var b = new Ray2(C, D); var forward1 = a1.Intersection(b); var forward2 = a2.Intersection(b); var reverse1 = b.Intersection(a1); var reverse2 = b.Intersection(a2); forward1.Should().NotBeNull(); forward1.Should().Be(forward2); forward1.Should().Be(reverse1); forward1.Should().Be(reverse2); }
public static void ray_ray_intersection_result() { var a = new Ray2(A, B); var b = new Ray2(C, D); var forward = a.Intersection(b); var reverse = b.Intersection(a); forward.Should().NotBeNull(); forward.Should().Be(reverse); }
private static void IntersectionTest(Ray2 a, Ray2 b, object expected) { AreSpatiallyEqual(expected, a.Intersection(b)); AreSpatiallyEqual(expected, b.Intersection(a)); }