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
Distance
Hit (1 / 0)
Overlap depth
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
| Symbol | Meaning |
|---|---|
x1 | Circle 1: x |
y1 | Circle 1: y |
r1 | Circle 1: radius |
x2 | Circle 2: x |
y2 | Circle 2: y |
r2 | Circle 2: radius |
d | Distance |
hit | Hit (1 / 0) |
depth | Overlap depth |
More formulas in this category
- Rectangle Collision (AABB)
- Linear Interpolation (lerp)
- Easing Functions
- Cubic Bézier Curves
- Projectile Path
- Reflection Vector
- Pseudo-Random Numbers (xorshift)
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