Create asymmetric 3D function by revolving a 2D function around an axis Could someone please let me know how I can construct the equation for asymmetric torus similar to the figure below? The asymmetric torus seems to be a 2D function revolved around an axis while being scaled. 
I think if I am able to formulate this, I can use the same strategy to revolve a 2D function $\omega_{\phi}\left(x,\sigma\right)$ around an axis, e.g. $x$-axis, and generate a 3D asymmetric function $g\left(x,y,z\right)$. The formula that I want to revolve while altering is:


In fact, the asymmetric torus is the iso-surface of $\omega$ after being revolved in three dimensions. In two-dimensions, i.e. the plane $\left(x,\sigma\right)$, contours of $\omega$ is almost a circle. Could someone help me?
 A: I'm not sure it gives exactly what you want, but consider the parameterization of the standard torus $$x=(R+r\cos \phi)\cos \theta \\ y=(R+r\cos \phi)\sin \theta \\ z=r \sin \phi$$
Now we want $r$ to vary sinusoidally with $\theta$, so try 
$$x=(R+r(\frac 32+\cos \theta)\cos \phi)\cos \theta \\ y=(R+r(\frac 32+\cos \theta)\cos \phi)\sin \theta \\ z=r (\frac 32+\cos \theta)\sin \phi$$
where I picked $\frac 32$ so the term in parentheses is always positive.  Try it, see if you like it.  I would start with $r = \frac R5$ and see how it goes.
A: I'm not entirely sure what you are looking for here. The "2D function" you are revolving around looks like you want a circle offset from the axis, so something like $(x-d)^2+y^2=r^2$ where $r$ is the radius of the circle and $d$ is the distance from the z-axis. If you then want to "rotate" it around the z axis we need to replace the $x$ above with $\sqrt{x^2+z^2}$. This would give us a "3D function" for the symmetric torus:-
$$(\sqrt{x^2+z^2}-d)^2+y^2=r^2$$ To make the radius and displacement changes as we go around $d$ and $r$ could become functions of $\theta=\tan^{-1}(\frac zx)$.
