i've just written a small java program that finds the intersection (if any)of two spheres, providing the parametric equation of the circle ofintersection if there is one, or the point of intersection in the case thatthey meet in a single point.

the way i did it was to firstly translate the whole system so that thecentre of the first sphere was at the origin, and then to rotate suitably sothat the centre of the second led on the positive x-axis.

from this situation it is easy to decide on the solution type, and also tofind the parametric equation of the circle of intersection (if it exists) bysimply finding 3 points of that circle, applying the inverse of the rotationpreviously used, and then finding the equation of the plane that the threepoints were contained in. from there the parametric solution of thesolution circle can be found from the intersection of that plane with eithersphere.

i was wondering if there was an easier way to do this? how would some ofyou approach this problem?