# How to graph the intersection of two surfaces

Another way of asking this is: How would one graph a 1 dimensional line (the intersection) in a 3 dimensional space.

Some context for the question:

Let's say I have two spheres

$$w_1^2=(x-x_1)^2+(y-y_1)^2+(z-z_1)^2$$ and $$w_2^2=(x-x_2)^2+(y-y_2)^2+(z-z_2)^2$$

assuming that the center of these circles are not at the same location and that they do intersect, there is a circle created by the intersection. This may be parallel to the xy plane, or that of the xz or yz planes, but it doesn't have to be.

In short, is there an equation I could put into a 3D graphing program that would draw that circle? I know that some data processing languages have the ability to do so, but I do not have access to those.

In general, I'd like to be able to do this with any surface, e.g. the intersection of two cones, or cones and planes, sphere and cone, etc.

Some context on my level of education, I just completed calculus 2 at my college.

• – lhf Jun 10 '15 at 1:33
• Though that does help, it wasn't exactly what I was looking for. Thanks, though. – CopaceticMan Jun 10 '15 at 3:18

## 1 Answer

Maybe some programs will plot the intersection exactly as you've written it. Mathematica won't, but there is a trick to doing it here.

For the spheres, you can work out the centre of the circle, it's the halfway point between the centres of the spheres. Then you need the plane containing the circle, and the radius of the circle.

In general, suppose you have a curve defined by $F(x,y,z) = 0$ and $G(x,y,z) = 0$. First solve the first equation for $z$, if possible. Then solve $G(x,y,z(x,y)) = 0$ for $y$, if possible. This will give you a rather ugly parametric curve, probably with branch cuts or $\pm$ signs.

The implicit function theorem guarantees that it's always technically possible to get a solution, but it won't be easy or pretty.

• It's not that I was trying to plot it exactly as such, but that I just needed a formal method that I could translate into code, and I didn't know how at all. – CopaceticMan Jun 10 '15 at 3:19
• In hind sight, I have to say this was more straight forward that I realized at the time. Just goes to show you how much my fundamentals were lacking then. And that was only a year ago. Thanks again. – CopaceticMan May 28 '16 at 6:05