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
 A: First, a minor correction to your formula:
$$z^2 = a^2 - \left(c - \sqrt{x^2 + y^2}\right)^2$$
represents a torus where the distance from the origin to the center of the "tube" is equal to $c$ and the radius of the "tube" is equation to $a$. That being said, it's more natural to ask how this is derived from a circle of the form
$$x^2 + y^2 = 10^2?$$
(Or, in general, the circle $x^2 + y^2 = c^2$.) To see this, recall the parametric form of the circle of radius $c$ (centered at the origin),
$$x(u) = c \cos(u), \quad y(u) = c \sin(u),$$
where $u \in [0, 2\pi)$ is the radial parameter. Let's now think about this circle lying in the $x,y$-plane in $x,y,z$-space, fix some $u = u_0$, and look at a torus with tube radius $a$ centered around this circle.
In each $u = u_0$ slice the picture looks like two circles of radius $a$ centered at distance $\pm c$ from the origin.Let $v \in [0, 2\pi)$ be another radial parameter representing these circles at a given $u_0$. The height of these circles (extending into the $z$-axis) is simply given by
$$z(v) = a \sin(v).$$
Given some $v = v_0$, we also shift our $x$- and $y$-positions from the circle of radius $c$ in the $x,y$-plane by the amount
$$a \cos(v) \quad \text{and} \quad a \cos(v)$$
respectively. This leads to the parametric form of the torus:
$$
\begin{align*}
x(u,v) &= \big(c + a \cos(v)\big)\cos(u), \\
y(u,v) &= \big(c + a \cos(v)\big)\sin(u), \\
z(u,v) &= a \sin(v).
\end{align*}
$$
What's left is verifying that this form is equivalent to the formula above. This is pretty straightforward. Hopefully, the parametric form provides a more natural perspective.
A: 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$

A: 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 "tubing"
$c$ = distance from the center of the torus to the middle of the "tubing"
$z=\pm\sqrt{a^2-(\sqrt{x^2+y^2}-r)^2}$
