Circle u0026 Polygon Collision Detection Quiz Quiz

Deepen your understanding of circle and polygon collision detection with focused questions on algorithms, edge cases, and geometric relationships. This quiz is designed to reinforce key concepts in computational geometry relevant to simulations, games, and graphic applications.

  1. Circle vs. Polygon: Point Inside Check

    When detecting a collision between a circle and a polygon, what is a common first step to determine if the circle's center is inside the polygon, for example, checking a ball inside a pentagon?

    1. Perimeter trace
    2. Ray casting method
    3. Distance from centroid
    4. AABB comparison

    Explanation: The ray casting method is often used to determine if a point (such as the circle's center) lies inside a polygon by counting how many times a line extending from the point crosses the polygon's edges. Using AABB comparison only provides a broad phase check and is not sufficient for detailed collisions. The distance from centroid does not determine point-in-polygon status, as polygons can be irregular. Perimeter trace is not a standard term or method for point-in-polygon detection.

  2. Closest Distance Calculation

    Which calculation determines if a circle is colliding with the edge of a polygon when the circle's center is outside the polygon, such as a disk near a triangle?

    1. Find the shortest distance from the circle's center to the polygon's edge
    2. Sum the radii of the circle and polygon
    3. Compare the circle's diameter with the polygon's area
    4. Check if the center coincides with the polygon's centroid

    Explanation: The shortest distance from the circle's center to any edge (or vertex) of the polygon is compared with the circle's radius to check for collision. The area of the polygon and the circle's diameter do not relate directly to collision detection. Summing the radii applies to circle-circle collisions, not circle-polygon situations. Coincidence with the centroid is irrelevant for edge-based collisions.

  3. Handling Vertex Collisions

    If a circle barely touches a polygon exactly at one of its vertices, what geometric relationship is true at the point of contact?

    1. The circle's center sits at the vertex
    2. The distance from the circle's center to the vertex equals the circle's radius
    3. The vertex lies inside the circle
    4. The vertex is at the midpoint of the polygon's edge

    Explanation: A collision at a single vertex means the distance from the circle's center to that vertex is exactly the radius, marking precise contact. If the vertex were inside the circle, the distance would be less than the radius, not equal. The vertex at an edge midpoint describes an edge case rather than a vertex collision. Placing the center at the vertex would mean an overlap rather than a touch.

  4. Separating Axis Theorem (SAT) Application

    Which step is unique to using the Separating Axis Theorem for circle-polygon collision detection, such as verifying overlap between a circular shield and a hexagon?

    1. Compare only the x and y projections of each shape
    2. Rotate the circle to align with the polygon orientation
    3. Project both shapes onto each potential axis including axes from the polygon's edges and the axis through the circle's center to the nearest edge point
    4. Check if the circle's center overlaps any polygon edge

    Explanation: SAT involves projecting both shapes onto relevant axes including those derived from polygon edges and the circle-to-edge direction. Comparing only x and y ignores necessary rotated axes. Rotating the circle is unnecessary for collision detection, as circles are orientation-invariant. Overlap of centers and edges is a different technique and not unique to SAT.

  5. Convex vs. Concave Shape Collisions

    Why is circle and convex polygon collision detection generally simpler than with concave polygons, like comparing collisions with an octagon versus a star-shaped figure?

    1. Convex polygons always fully contain the circle
    2. Concave polygons have larger areas
    3. Convex shapes have no inward dents, so every closest point is on the edge or vertex
    4. Convex collision detection ignores the circle's radius

    Explanation: Convex polygons lack concave regions, making the closest point calculation straightforward as it falls on an edge or vertex. The idea that convex polygons always contain the circle is false, as circles can be outside. Area does not impact the complexity of collision checks. Circle's radius must be considered for both convex and concave polygons; it is not ignored.