Collision

Collision detection and intersection demos.

Line Intersection

Loading...

Drag line handles to test collision. Red dots show line intersections.

Circle Collision

Circles collide when the distance between their centres is less than the sum of the radiuses.

Loading...

Drag circles to test collision.

Rectangle Collision

Rectangles with no rotation (axis aligned) will collide if there is no gap between any of the 4 sides of both rectangles.

Loading...

Drag corners to test collision.

Polygon Collision

Separating Axis Theorem can detect collision between any two convex polygons.

Loading...

Drag corners to test collision.

Sources