# need help rotating an object about the z-axis using animation

This should be an easy question for anyone familiar with 3D animations. I have a 2D shape denoted by the equation

       ((x-1)^2+y^2) ((x+1)^2+y^2)==1


and I want to illustrate its relation to a Horn Torus. To do this, I would like to rotate it about the $z$-axis in 3-space and have an outline of the shape be created behind it. I appreciate any help you guys can give me.

-
Check out SphericalPlot3D –  Sjoerd C. de Vries Jan 24 at 6:47

When I'm not mistaken, then the short answer is

SphericalPlot3D[Sqrt[2]*Sqrt[Cos[2*(φ + Pi/2)]], {φ, 0, Pi}, {ϕ, 0, 3/2 Pi}]


Here a longer explanation how to achieve this. Be warned that there is surely an easier method.

First of all, you have an equation in $x$ and $y$ which cannot simply be converted into a closed-form function $f(x)$. Nevertheless, you can plot it using ContourPlot which searches for the points that fulfill your equation.

ContourPlot[((x - 1)^2 + y^2) ((x + 1)^2 + y^2) == 1, {x, -2, 2}, {y, -2, 2}]


Here you notice that the plot is kind of radial to the origin and I had the feeling, that your equation might be simpler in polar coordinates.

expr = TransformedField["Cartesian" -> "Polar",
((x - 1)^2 + y^2) ((x + 1)^2 + y^2) - 1, {x, y} -> {r, phi}] // FullSimplify
(* r^4 - 2 r^2 Cos[2 phi] *)


Indeed, this looks way better. We can solve this for r and get

expr2 = r /. Solve[expr == 0, r] // Last
(* Sqrt[2] Sqrt[Cos[2 phi]] *)


an explicit function $r(phi)$ which can be plotted in polar coordinates

PolarPlot[expr2, {phi, -Pi, Pi}]


The only thing left is to rotate this plot about 90 degrees by adding Pi/2 to phi so that SphericalPlot3D creates the surface in the right form.

-
Thank you very much, hal! –  user11781 Jan 24 at 8:26