public static bool Intersects(Point point, Circle circle) { Point vec = new Point(point.X - circle.Center.X, point.Y - circle.Center.Y); float sqDist = vec.X * vec.X + vec.Y * vec.Y; return sqDist <= circle.Radius * circle.Radius; }
public static bool Intersects(Rectangle rect, Circle circle) { float sqDist = SqDistPointRect(circle.Center, rect); return sqDist <= circle.Radius * circle.Radius; }
public static bool Intersects(Rectangle rect, Circle circle) { float sqDist = SqDistPointRect(circle.Center, rect); return(sqDist <= circle.Radius * circle.Radius); }
public bool Intersects(Rectangle rect) { Circle c = new Circle(); c.Center = new Point((StartPos.X + EndPos.X) / 2, (StartPos.Y + EndPos.Y)/2); c.Radius = 5; return GeometryHelper.Intersects(rect, c); }
public bool Intersects(Rectangle rect) { Circle c = new Circle(); c.Center = Pos; c.Radius = Radius; return GeometryHelper.Intersects(rect, c); }