How to derive the 3D equation of a torus? I'm doing a presentation on 3D surfaces for college and one of the equations I am using is a Torus. I know that the equation is

$$z^2 = 25 - \left(10 - \sqrt{x^2 + y^2}\right)^2$$

For a torus with radius 5, with the inner circle 10 units away from the z axis but I was wondering how this is derived from a circle of the form 

$$x^2 + y^2 = 15^2$$

Being the centre for the other circles in the $oxz$ and $oxy$ planes (15 being the distance from the $z$ axis + the radius.

Thanks, Any help will be appreciated
Let's select one point $p = (x, y, 0)$. Distance from point p to origin is $\sqrt{x^2 + y^2}$ Distance from point $p$ to the circle with radius $r$ in $xy$-plane is $d = \lvert r - \sqrt{x^2 + y^2} \rvert$. Point $(x, y, z)$ is on the surface of torus if it satisfies $d^2 + z^2 = h^2$ ie. $z^2 = h^2 - \left(r - \sqrt{x^2 + y^2} \right)^2$
First of all, to understand how the equation for a torus relates to that of a circle you must become familiar with the object: $\sqrt{x^2+y^2}$. As you can probably guess, this takes any point $p$ on the $x$-$y$ plane and generates $p$'s distance from the origin. The useful aspect of this tool is that it treats any point within the same distance of the origin as the same. Therefore, in order to create objects that are rotationally symmetric about the $z$-axis, it is essential to treat $z$ as a function of radius $r$ and then later substitute $r$ with $\sqrt{x^2+y^2}$.
Since we know that the torus is rotationally symmetric, we can simplify it by finding the equation to its cross section (by any origin intersecting plane perpendicular to the $x$-$y$ plane). We then get the graph of a circle translated horizontally.
Keep in mind that the horizontal axis is radius $r$ and the vertical axis is $z$. Now you may now see how the equation for a circle arises-- it's just the graph of $\pm\sqrt{a^2-(r-c)^2}=z$. Variable c is the length from the origin to the center of the circle while a is the radius of the circle.
Now we can expand this into three dimension by replacing the r with $\sqrt{x^2+y^2}$.
By then you have two parameters
$a$ = radius of the &quot;tubing&quot;
$c$ = distance from the center of the torus to the middle of the &quot;tubing&quot;
$z=\pm\sqrt{a^2-(\sqrt{x^2+y^2}-r)^2}$