static public bool Intersect(LineSegment seg, Ray ray) { Point intersection = PrivateIntersection(ray.UnderlyingLine, seg.UnderlyingLine, out bool possible); if (!possible) { return(false); } return(seg.OnSegment(intersection) && ray.OnRay(intersection)); }
static public bool Intersect(LineSegment seg1, LineSegment seg2) { Point intersection = PrivateIntersection(seg1.UnderlyingLine, seg2.UnderlyingLine, out bool possible); if (!possible) { return(false); } return(seg1.OnSegment(intersection) && seg2.OnSegment(intersection)); }