
The equations of the spheres are given by:
(x − x_{1})^{2} + (y − y_{1})^{2} + (z − z_{1})^{2} = r_{1}^{2} (1) 
(x − x_{2})^{2} + (y − y_{2})^{2} + (z − z_{2})^{2} = r_{2}^{2} (2) 
The outer intersection points of the two spheres forms a circle (AB) with radius h
which is the base of two spherical caps.
To make calculations easier we choose the center of the first sphere at (0 , 0 , 0) and the second sphere
at (d , 0 , 0).
The distance d between the spheres centers is:

Now we can find the angle α and θ by the cosine law:
Once we found the angle α we can find the intersection circle radius h.
The height of the spherical cap 1 is: 
h_{1} = r_{1} * (1 − cos α) 
The height of the spherical cap 2 is: 
h_{2} = r_{2} * (1 − cos θ) 
NOTE: 
when α or θ is bigger then 90 degrees then the spherical cap height is more then the radius and the volume of the cap is more then half sphere. 
The volume of the lapping area which contains the two spherical caps is:
The equation of a sphere can be described by the equation: x^{2} + y^{2} + z^{2} + Ax + By + Cz + D = 0
The connections of the coefficients A, B, C and D to eq. (1) are:
A_{1} = − 2x_{1} 
B_{1} = − 2y_{1} 
C_{1} = − 2y_{1} 
D_{1} = x_{1}^{2} + y_{1}^{2} + z_{1}^{2} − r_{1}^{2} 
If both spheres are given in this form the distance d between spheres centers is:
Sphere 1 radius is:
If we subtract the two spheres equations from each other we receive the equation of the plane that passes through the intersection points of the two spheres and contains the circle AB.
X 2(x_{2} − x_{1}) + Y 2(y_{2} − y_{1}) + Z 2(z_{2} − z_{1}) + x_{1}^{2} − x_{2}^{2} + y_{1}^{2} − y_{2}^{2} + z_{1}^{2} − z_{2}^{2} − r_{1}^{2} + r_{2}^{2} = 0 (3)
General plane equation is: 
XA + YB + ZC + D = 0 
where: 
A = 2(x_{2} − x_{1}) 
B = 2(y_{2} − y_{1}) 
C = 2(z_{2} − z_{1}) 
D = x_{1}^{2} − x_{2}^{2} + y_{1}^{2} − y_{2}^{2} + z_{1}^{2} − z_{2}^{2} − r_{1}^{2} + r_{2}^{2} 

The equation of the line that connects the sphere’s centers is by parametric line equation
x = x_{1} + t(x_{2} −x_{1}) 
y = y_{1} + t(y_{2} −y_{1}) 
z = z_{1} + t(z_{2} −z_{1}) 
(4) 
The center point of circle AB is located at the point of intersection of the parametric line connecting the spheres centers eq. (4) and the plane of the spheres intersection eq. (3) which also contains the circle AB.
By substituting eq. (4) into eq. (3) we can find the value of t which is:
(x_{1} + t x_{2} − t x_{1})A + (y_{1} + t y_{2} − t y_{1})B + (z_{1} + t z_{2} − t z_{1})C + D = 0
Substitute the value of t into eq. (4) to get the coordinate of the intersection circle (AB) center.

The type of intersection of two spheres depends on the size of the radii and the distance between the sphere’s centers.
Description 
Result 
d < r_{1} + r_{2} d > r_{1} − r_{2} 
Conditions for intersection 
d > r_{1} + r_{2} 
Two separate spheres 
d = r_{1} + r_{2} 
Outer tangency 
d < r_{1} − r_{2} 
One sphere inside the other 
d = r_{1} − r_{2} 
inner tangency 

