Determine whether a rectangle and a circle are intersecting
Ideas:
Method 1: first determine whether the rectangle is in the circle (whether the four vertices of the rectangle are in the circle). If so, otherwise, judge whether the shortest distance from the center of the circle to the four sides of the rectangle (the shortest distance from the point to the line segment) is smaller than the radius. If yes, the rectangle (including the circle) is not intersecting, ).
Method 2: The Circular split plane is divided into four parts. Method 2: The Circular split plane is divided into four parts, which are separated by the following types: the rectangle is above the circular area, the rectangle is under the circular area, and the rectangle is on the left side of the circular area, the rectangle is on the right of the circle, inside the circle, and inside the rectangle.
Method 3: The rectangle is divided into nine parts in the plane. The four sides of the rectangle are used to divide the space into nine areas. The center of the rectangle is located in that area. If it is inside the rectangle, the intersection is inevitable. If it is located in the top, bottom, left, and right sides of the four edge areas, it checks the distance from the center to the edge to determine whether it is intersecting. If it is located in the area corresponding to the four corner points, check whether the four corners of the rectangle are inside the circle.
[Reference]
Http://www.cnblogs.com/hxsyl/p/3250015.html
Determine whether a rectangle and a circle are intersecting