0
$\begingroup$
ParametricPlot3D[{Cos[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
  Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
  Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}]

How to additionally draw z-level curves (by Show or other means) in the above plot of Klein Bottle ( from documents)? Truncating $z$ by a PlotRange setting shows only a single pair of intersections on the surface per plot.

$\endgroup$

2 Answers 2

2
$\begingroup$

Use "MeshFunctions", as in:

ParametricPlot3D[{Cos[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, 
MeshFunctions -> {#3 &}, Mesh -> {{-1, 0, 1}}, MeshStyle -> Thick, 
PlotStyle -> Opacity[0.2], PlotPoints -> 100]
$\endgroup$
0
$\begingroup$

An approach...take the expression for the Z terms, and solve them for a term Z

zterm = Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]
Solve[zterm == zz, {u}]

you get an expression that includes

{u -> ConditionalExpression[2 ArcTan[(
  zz Sin[2 v] - 
 Sqrt[-zz^2 Sin[v]^2 + Sin[v]^4 + Sin[v]^2 Sin[2 v]^2])/(
Sin[v]^2 + Sin[2 v]^2), 
Csc[v] (zz - (zz Sin[2 v]^2)/(Sin[v]^2 + Sin[2 v]^2) + (
 Sin[2 v] Sqrt[-Sin[v]^2 (zz^2 - Sin[v]^2 - Sin[2 v]^2)])/(
 Sin[v]^2 + Sin[2 v]^2))] + 2 \[Pi] C[1]), 
 C[1] \[Element] Integers]

Pick off the equation in the conditional expression and assign it to uu

uu = 2 ArcTan[(
  zz Sin[2 v] - 
   Sqrt[-zz^2 Sin[v]^2 + Sin[v]^4 + Sin[v]^2 Sin[2 v]^2])/(
  Sin[v]^2 + Sin[2 v]^2), 
  Csc[v] (zz - (zz Sin[2 v]^2)/(Sin[v]^2 + Sin[2 v]^2) + (
 Sin[2 v] Sqrt[-Sin[v]^2 (zz^2 - Sin[v]^2 - Sin[2 v]^2)])/(
 Sin[v]^2 + Sin[2 v]^2))]

Then do a 2D ParametricPlot, replacing u with uu. Here you can manipulate it to see what you have.

Manipulate[
   ParametricPlot[{Cos[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]), 
   Sin[u] (3 + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v])} /. {u -> 
    uu} /. zz -> height, {v, 0, 2 Pi}], {height, -1, 1}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.