Circle Equation — Center and Radius on a Grid

By dan • June 2, 2026 • 3 min read

# Circle Equation — Center and Radius on a Grid

## Plain English first

A circle is every point that is exactly distance r from a center point (h, k). That's the definition.

Now use the distance formula: the distance from any point (x, y) to the center (h, k) is √((x−h)² + (y−k)²). Set that equal to r and you have the circle equation. Square both sides to remove the square root and you get the standard form.

The equation is just the Pythagorean theorem, applied to every point on the circle at once.

---

## Standard math notation

```
Standard form:
(x − h)² + (y − k)² = r²

Where:
(h, k) = center of the circle
r = radius

Reading it: "every point (x,y) whose distance from (h,k) equals r"

Special case — circle centered at origin (h=0, k=0):
x² + y² = r² (the unit circle when r=1)

Expanding to general form:
x² + y² − 2hx − 2ky + (h² + k² − r²) = 0
or: Ax² + Ay² + Dx + Ey + F = 0 (where A=1 for circles)
```

---

## Verbose Python with descriptive names

```python
def check_if_point_is_on_circle(
x_of_point,
y_of_point,
x_of_circle_center,
y_of_circle_center,
radius_of_circle
):
"""
A point is on the circle if its distance from the center equals the radius.
Distance² = (x-h)² + (y-k)²
On circle if distance² == r² (avoid floating point with sqrt)
"""
distance_squared = (
(x_of_point - x_of_circle_center)**2 +
(y_of_point - y_of_circle_center)**2
)
radius_squared = radius_of_circle ** 2
return abs(distance_squared - radius_squared) < 1e-9

def extract_center_and_radius_from_equation(h, k, r):
"""
Given (x-h)² + (y-k)² = r², return center and radius.
"""
return {'center': (h, k), 'radius': r}

def compute_y_on_circle(
x_of_point,
x_of_circle_center,
y_of_circle_center,
radius_of_circle
):
"""
Given x and the circle, find the y-values on the circle at that x.
From: (x-h)² + (y-k)² = r²
→ (y-k)² = r² - (x-h)²
→ y = k ± √(r² - (x-h)²)
"""
horizontal_distance = x_of_point - x_of_circle_center
remaining_squared = radius_of_circle**2 - horizontal_distance**2
if remaining_squared < 0:
return [] # x is outside the circle entirely
vertical_offset = remaining_squared ** 0.5
y_top = y_of_circle_center + vertical_offset
y_bottom = y_of_circle_center - vertical_offset
return [y_top, y_bottom]

# Unit circle centered at origin: x² + y² = 1
print(check_if_point_is_on_circle(1, 0, 0, 0, 1)) # True (rightmost point)
print(check_if_point_is_on_circle(0, 1, 0, 0, 1)) # True (topmost point)
print(check_if_point_is_on_circle(0.5, 0.5, 0, 0, 1)) # False (inside circle)

# Circle centered at (3, -2) with radius 5
center_and_radius = extract_center_and_radius_from_equation(h=3, k=-2, r=5)
print(center_and_radius) # {'center': (3, -2), 'radius': 5}
```

---

## Connection to the distance formula

```python
# The circle equation IS the distance formula set equal to r:
#
# Distance formula: d = √((x-h)² + (y-k)²)
# Circle definition: d = r (every point is exactly r from center)
#
# Substitute: √((x-h)² + (y-k)²) = r
# Square both: (x-h)² + (y-k)² = r²
#
# That's the standard form. No new math — just the distance formula.
```

---

## See also
- [Distance Formula — Pythagorean on a Grid](/articles/3c8025ce-c59a-46bf-987f-975ae59d68ca)
- [Pythagorean Theorem — Squares on Sides](/articles/4d64ff4e-28db-4c2b-8415-8751fd5adecf)
- [Circle Area — Why πr²?](/articles/6156ae8e-6c73-4c17-8916-8259a21cad23)
- [Sine and Cosine — Waves from a Spinning Point](/articles/d80a1d77-f009-41f8-8cf6-824aac810291)
- [Math Foundations — Visual Table of Contents](/articles/d404884f-54fc-4289-b3f1-baaad2bec6b2)