public PointF?Intersect(LineSegment other) { var p = line.Intersect(other.line); if (p == null) { return(null); } if (bindingRectangle.Contains(p.Value) && other.bindingRectangle.Contains(p.Value)) { return(p); } return(null); }
public PointF?Intersect(LineEquation other) { if (isVertical && other.isVertical) { return(null); } if (a == other.a) { return(null); } if (isVertical) { return(other.Intersect(xConstForVertical)); } if (other.isVertical) { return(Intersect(other.xConstForVertical)); } // both have slopes and are not parallel var x = (b - other.b) / (other.a - a); return(Intersect(x)); }
public (bool Intersects, Vector Location) FindIntersect(LineEquation l) { var intersect = Line.Intersect(l); return(PointWithinBox(intersect), intersect); }