public static IntersectionResult ParabolaRectangle(GCurve c, GRectangle r) { IntersectionResult result = new IntersectionResult(); foreach (var line in r.Lines) { var temp = CurveLine(c, line); if (temp.IntersectionPoints.Count != 0) { result.IntersectionPoints.AddRange(temp.IntersectionPoints); } } return(result); }
public static IntersectionResult CircleRectangle(GCircle circle, GRectangle rec) { var result = new IntersectionResult(); foreach (var line in rec.Lines) { var intersect = CircleLine(circle, line); if (intersect.IntersectionPoints.Count > 0) { result.IntersectionPoints. AddRange(intersect.IntersectionPoints); } } return(result); }