How this instrument works
(x − h)² + (y − k)² + (z − l)² = r² is the 3D distance formula wearing a disguise. The left side is the squared straight-line distance from a point (x, y, z) to a center (h, k, l); setting that equal to r² simply says every point on the sphere is exactly r units from the center, which is the definition of a sphere itself. Nothing about the equation is special beyond that: it is the ordinary distance-squared formula, held at a fixed value.
That distance formula is two Pythagorean theorems stacked. Find the distance across the base first — treat h and k as one leg pair, ignore l and z entirely, and √((x−h)² + (y−k)²) is the flat, two-dimensional distance, exactly the circle-equation calculation elsewhere on this site. Then treat that flat distance and the height difference (z − l) as the two legs of a second right triangle, standing straight up out of the base one, and its hypotenuse is the true 3D distance to the center. Squaring both ends of that second triangle folds all three coordinate differences into one sum, which is why the sphere's equation simply tacks a third squared term onto a circle's.
This sheet rearranges the equality into a single signed number instead of a yes-or-no check: test = (x−h)² + (y−k)² + (z−l)² − r². A point on the surface makes both sides equal, so test lands on exactly 0. Move the point closer to the center and the squared-distance term shrinks below r², so test turns negative; move it farther out and test turns positive. The sign alone classifies inside, on, or outside — no square root, and no need to compute the actual distance, ever required.
- Enter the sphere's center coordinates into Center: h, Center: k, and Center: l.
- Enter the sphere's size into Radius.
- Enter the point you want to check into Test point: x, Test point: y, and Test point: z.
- Read the result field, labeled (x−h)² + (y−k)² + (z−l)² − r² (0 = on the sphere): zero means the point sits exactly on the surface, negative means inside, positive means outside.
- Change only the test point and watch the result cross zero as the point moves from inside to outside the fixed sphere.
Worked example — a point exactly on the surface
Take a sphere centered at (2, 3, 4) with radius 5, so h = 2, k = 3, l = 4, r = 5. Check the point (7, 3, 4): x = 7, y = 3, z = 4. That point matches the center's y and z exactly and differs only in x, by exactly the radius — it sits five units straight out from the center along the x-direction. The test value is (7−2)² + (3−3)² + (4−4)² − 5² = 25 + 0 + 0 − 25 = 0.
Zero means (7, 3, 4) lies precisely on the sphere's surface, not merely close to it. Nudge the test point to the center itself, (2, 3, 4), and every squared term vanishes, leaving test = 0 − 25 = −25, the most negative reading this particular sphere can ever produce, since no other point sits farther inside. Nudge it instead far outside — a sphere at the origin with radius 3, checked against (10, 10, 10) — and the three squared terms alone total 300, giving test = 300 − 9 = 291, a large positive number that immediately flags the point as well clear of the surface.
Questions
What is the equation of a sphere?
(x − h)² + (y − k)² + (z − l)² = r², where (h, k, l) is the center and r is the radius. It states that every point (x, y, z) on the sphere sits at squared distance r² from the center — the 3D distance formula fixed at one constant value, the direct extension of a circle's (x − h)² + (y − k)² = r² with a third coordinate added.
How do I tell if a point is inside, on, or outside a sphere?
Plug the point into test = (x − h)² + (y − k)² + (z − l)² − r² and read the sign: zero means on the surface, negative means inside, positive means outside. Because both sides of the original equation are already squared, this works without ever taking a square root or computing an actual distance.
Why does the formula use squared terms instead of the plain distance?
Squaring first and comparing to r² avoids a square root entirely, since the original definition is distance = r, and squaring both sides gives distance² = r² without changing which points satisfy it. It also keeps every term positive before the subtraction, so the only thing that can make the total run below r² is the point actually sitting inside.
How is a sphere's equation related to a circle's equation?
A sphere's equation is a circle's equation with one more squared term. (x − h)² + (y − k)² = r² fixes every point at distance r from a center in a flat plane; adding (z − l)² lifts that same idea into three dimensions, using the same logic twice over — once for the flat distance, once more for the vertical rise, per the two-Pythagorean-theorem derivation of 3D distance.
What's the most common mistake when using this formula?
Forgetting to subtract r² and instead treating the sum of the three squared differences as the answer by itself. That sum is the squared distance to the center, not the test value — subtracting r² is what turns it into a signed reading that is zero exactly on the surface rather than always positive.
Does it matter whether I write (x − h) or (h − x) in the formula?
No — both differences get squared immediately, and squaring erases the sign, so (x − h)² and (h − x)² are always identical. The order only matters if you are computing the plain, unsquared distance somewhere else in a calculation and need the sign to mean something.