Circle Collision

Two circles overlap when the distance between centres is at most the sum of the radii.

(x₂ − x₁)² + (y₂ − y₁)² ≤ (r₁ + r₂)²

Compare the squared distance with the squared sum of radii to skip the square root.

Push the circles apart along the line between centres by the overlap depth (r₁ + r₂ − d) to resolve the hit.

Calculator

Change a value and the result and picture update instantly.

Result

Distance2.69258
Hit (1 / 0)1
Overlap depth0.0074176

Animated picture

The picture follows your values. Some points and shapes can be dragged.

Use in game development

Bullets vs enemies, balls vs balls, characters vs characters. Drag the circles in the picture.

Code example (JavaScript)

const dx = b.x - a.x, dy = b.y - a.y, rr = a.r + b.r;
const hit = dx*dx + dy*dy <= rr*rr;

What the symbols mean

SymbolMeaning
x1Circle 1: x
y1Circle 1: y
r1Circle 1: radius
x2Circle 2: x
y2Circle 2: y
r2Circle 2: radius
dDistance
hitHit (1 / 0)
depthOverlap depth

More formulas in this category

Frequently asked questions

What is the formula for Circle Collision?
The formula for Circle Collision is (x₂ − x₁)² + (y₂ − y₁)² ≤ (r₁ + r₂)². Two circles overlap when the distance between centres is at most the sum of the radii.

Math Formula Quiz Math for Game Development

Sources

Checked: 2026-11-29