public static IEnumerable <Point2D> PlotLOS(IPoint2D p, Direction d, Angle yaw, double distance) { var a = FromDirection(d); var p2 = GetPoint2D(p.X, p.Y, a - yaw, distance); var p3 = GetPoint2D(p.X, p.Y, a + yaw, distance); return(Triangle2D.Plot(p, p2, p3)); }
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 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 bool TryParse(string value, out Triangle2D t) { try { t = Parse(value); return(true); } catch { t = Empty; return(false); } }
public static bool TryParse(string value, out Triangle2D t) { try { t = Parse(value); return true; } catch { t = Empty; return false; } }
public static bool Intersects(Triangle2D t, Rectangle2D r) { return(Intersect(t, r).Any()); }
public static bool Intersects(Triangle2D t1, Triangle2D t2) { return(Intersect(t1, t2).Any()); }
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 })); }
public bool Intersects(Triangle2D t) { return(Intersects(this, t)); }
public IEnumerable <Point2D> Intersect(Triangle2D t) { return(Intersect(this, t)); }
public static bool Intersects(Triangle2D t, Rectangle2D r) { return Intersect(t, r).Any(); }
public static bool Intersects(Triangle2D t1, Triangle2D t2) { return Intersect(t1, t2).Any(); }
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}); }
public bool Intersects(Triangle2D t) { return Intersects(this, t); }
public IEnumerable<Point2D> Intersect(Triangle2D t) { return Intersect(this, t); }