Intersection of two spheres

Written by Paul Bourke
November 1995


Consider two spheres on the x axis, one centered at the origin, separated by a distance d, and of radius r1 and r2.

The equations of the two spheres are

x2 + y2 + z2 = r12

(x - d)2 + y2 + z2 = r22

Subtracting the first equation from the second, expanding the powers, and solving for x gives

x = [ d2 - r22 + r12] / 2 d

The intersection of the two spheres is a circle perpendicular to the x axis, at a position given by x above. Substituting this into the equation of the first sphere gives

y2 + z2 = [4 d 2 r12 - (d2 - r22 + r12)2 ] / 4 d2

You might recognise this is the equation of a circle with radius h

where

h2 = [4 d 2 r12 - (d2 - r22 + r12)2 ] / 4 d2