# Finding the contact point of two spheres

Is there a way to get the normal and depth of two spheres that have collided.

I know that it is something to do with the center and radius of two spheres but I am not sure what

• Downvoter, can you please explain why you downvoted. Feedback will be appreciated so I can modify the post. – user116458 Jun 6 '18 at 11:39

Distance between sphere centers is length(c1.center - c2.center)
Depth is distance - radius1 - radius2 = length(c1.center - c2.center) - c1.radius - c2.radius
Normal is normalized(c1.center - c2.center) for c2 and the inverse of that for c1.
• It may be worth mentioning that the point of contact on the surface of the sphere is c1.center - normal * c1.radius / c2.center + normal * c2.radius). If the spheres just touch without penetrating, then these two surface contact points will be the same. – DMGregory Aug 9 '18 at 15:35