private void Intersect_CollinearContaining(Segment2 segment1, Segment2 segment2)
 {
     IntersectionSegmentSegment2 intersection;
     IsTrue_IntersectSegmentSegment(segment1, segment2, out intersection);
     Assert.AreEqual(IntersectionType.Segment, intersection.type, segment1.ToString("F8") + "\n" + segment2.ToString("F8"));
     AreEqual(intersection.pointA, segment2.a);
     AreEqual(intersection.pointB, segment2.b);
     IsTrue_IntersectSegmentSegment(segment2, segment1, out intersection);
     Assert.AreEqual(IntersectionType.Segment, intersection.type, segment1.ToString("F8") + "\n" + segment2.ToString("F8"));
     AreEqual(intersection.pointA, segment2.a);
     AreEqual(intersection.pointB, segment2.b);
 }
        private void IsFalse_Intersect(Ray2D ray, Segment2 segment)
        {
            IntersectionRaySegment2 intersection;

            Assert.IsFalse(Geometry.IntersectRaySegment(ray.origin, ray.direction, segment.a, segment.b, out intersection),
                           ray.ToString("F8") + "\n" + segment.ToString("F8"));
        }
Esempio n. 3
0
        private void IsFalse_Intersect(Line2 line, Segment2 segment)
        {
            IntersectionLineSegment2 intersection;

            Assert.IsFalse(Geometry.IntersectLineSegment(line.origin, line.direction, segment.a, segment.b, out intersection),
                           line.ToString("F8") + "\n" + segment.ToString("F8"));
        }
 private void Intersect_CoincidentContradirected(Vector2 a, Vector2 b)
 {
     var segment1 = new Segment2(a, b);
     var segment2 = new Segment2(b, a);
     IntersectionSegmentSegment2 intersection;
     Assert.IsTrue(Geometry.IntersectSegmentSegment(segment1, segment2, out intersection), segment1.ToString("F8"));
     Assert.AreEqual(IntersectionType.Segment, intersection.type);
     AreEqual(intersection.pointA, segment1.a);
     AreEqual(intersection.pointB, segment1.b);
 }
 private void IsFalse_IntersectSegmentSegment(Segment2 segment1, Segment2 segment2, out IntersectionSegmentSegment2 intersection)
 {
     Assert.IsFalse(Geometry.IntersectSegmentSegment(segment1, segment2, out intersection),
         segment1.ToString("F8") + "\n" + segment2.ToString("F8"));
 }