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

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.