Whether a point is inside a circle, on it, or outside is found by substituting its coordinates into the circle's equation and comparing. Take , with centre at the origin and radius .
The square of the distance from a point to the centre is . Compare this with the square of the radius.
| Condition | Position |
|---|---|
| inside the circle | |
| on the circle | |
| outside the circle |
| Point | Position | |
|---|---|---|
| inside | ||
| on the circle | ||
| outside |
Computing the distance itself leads to the same conclusion, of course: lies from the centre, less than the radius. But distances are never negative, so comparing their squares preserves the order. Skipping the square root is faster and avoids the rounding error it would introduce, which is why the squared comparison is standard. Collision checks against circular hitboxes in games are written exactly this way.
The outside point sits from the centre.
| Quantity | Computation | Value |
|---|---|---|
| Nearest distance | ||
| Farthest distance |
The line joining the point to the centre pierces the circle at exactly its nearest and its farthest points.
For a circle of centre and radius , compare with . The sign of the left side minus the right side gives the position directly: negative inside, zero on the circle, positive outside.
This test also illustrates how an inequality describes a region. The inequality describes the interior of the circle, a piece of the plane rather than a curve. One equation gives a curve; turning it into an inequality gives an area. It is the same relationship as between the line and the half-plane .
The large dots on the graph are the inside point, the on-circle point, and the outside point.