public static IEnumerable <Point2D> Intersect(Triangle2D t, Rectangle2D r) { return(Line2D.Intersect( new[] { t._AB, t._BC, t._CA }, new[] { new Line2D(r.X, r.Y, r.X + r.Width, r.Y), new Line2D(r.X + r.Width, r.Y, r.X + r.Width, r.Y + r.Height), new Line2D(r.X, r.Y, r.X, r.Y + r.Height), new Line2D(r.X, r.Y + r.Height, r.X + r.Width, r.Y + r.Height) })); }
public static IEnumerable <Point2D> Intersect(Triangle2D t1, Triangle2D t2) { return(Line2D.Intersect(new[] { t1._AB, t1._BC, t1._CA }, new[] { t2._AB, t2._BC, t2._CA })); }