I have found the following parametrisation for a Klein bottle:
a = 6 Cos[2 u] (1 + Sin[u]);
b = 16 Sin[u];
c = 4 (1 - Cos[u]/2);
fx = If[Pi < u <= 0, a + c Cos[v + Pi], a + c Cos[u] Cos[v]];
fy = If[Pi < u < 2 Pi, b, b + c Sin[u] ];
fz = c Sin[v];
I am trying to plot it using
ParametricPlot3D[{fx, fy, fz}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
Boxed -> False, Axes -> False]
but the result is not quite the Klein bottle.
The reference I am using is this one (page 141) where you can see the same parameterization.
- Any ideas why it does not work with me?
- Also how can I change the colours of the surface to be as in the book?
Answer
Here's my slight simplification of the Klein bottle parametric equations. I believe the original parametrization is due to Stewart Dickson (whose depiction of the bottle was in the "Graphics Gallery" of the old versions of The Mathematica Book).
ParametricPlot3D[{6 Cos[u] (1 + Sin[u]), 16 Sin[u], 0} + 2 (2 - Cos[u])
{Cos[Clip[u, {0, π}]] Cos[v], Sin[Clip[u, {0, π}]] Cos[v], Sin[v]},
{u, 0, 2 π}, {v, 0, 2 π}, Lighting -> "Classic", Mesh -> False,
PlotStyle -> Opacity[2/3, ColorData["Legacy", "AliceBlue"]]]
I have elected to use translucency instead to reveal the inner structure of the bottle. If you want to cut the bottle, just restrict the parameter ranges, like so:
ParametricPlot3D[{6 Cos[u] (1 + Sin[u]), 16 Sin[u], 0} + 2 (2 - Cos[u])
{Cos[Clip[u, {0, π}]] Cos[v], Sin[Clip[u, {0, π}]] Cos[v], Sin[v]},
{u, 0, 2 π}, {v, π, 2 π}, Mesh -> False, PlotTheme -> "Classic"]
(Have a look at Franzoni's article as well to see other possible variations.)
Comments
Post a Comment