Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 public static bool Intersects(Rectangle rect, Circle circle)
 {
     float sqDist = SqDistPointRect(circle.Center, rect);
     return sqDist <= circle.Radius * circle.Radius;
 }
Esempio n. 3
0
        public static bool Intersects(Rectangle rect, Circle circle)
        {
            float sqDist = SqDistPointRect(circle.Center, rect);

            return(sqDist <= circle.Radius * circle.Radius);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        public bool Intersects(Rectangle rect)
        {
            Circle c = new Circle();
            c.Center = Pos;
            c.Radius = Radius;

            return GeometryHelper.Intersects(rect, c);
        }