1

This question may be related to a previous query at Plotting a contour on a torus My question is how do you enclose double helix structures (see demonstrations.wolfram.com/DoubleHelix ) inside an ellipsoidal cavity and also within a torus. Following the examples in the previous query, I show a typical case below for the torus, but the coils are not in phase:

With[{rr = 3, r = 1}, 
  torus[{u_, v_}] := {(rr + r*Cos[2*Pi*u])*
     Cos[2*Pi*v], (rr + r*Cos[2*Pi*u])*Sin[2*Pi*v], r*Sin[2*Pi*u]}]*
   (gr = ContourPlot[
     Re[2*Exp[4*Pi*I*(x + 2*y)] + 3*Exp[4*Pi*I*(x - 2*y)]] == 0, {x, 
      0, 1}, {y, 0, 1}]; )*
   (gr1 = 
    ContourPlot[
     Re[2*Exp[4*Pi*I*(x - 2*y)] + 3*Exp[4*Pi*I*(x + 2*y)]] == 0, {x, 
      0, 1}, {y, 0, 1}]; )*
   Show[ParametricPlot3D[torus[{u, v}], {u, 0, 1}, {v, 0, 1}, 
   PlotStyle -> Directive[Opacity[0.3], Red], Mesh -> None], 
     Graphics3D[{Blue, 
    Cases[Normal[gr], Line[__], Infinity] /. 
     Line[pts_] :> Tube[torus /@ pts]}], 
     Graphics3D[{Red, 
    Cases[Normal[gr1], Line[__], Infinity] /. 
     Line[pts_] :> Tube[torus /@ pts]}]]!

enter image description here

thils
  • 3,228
  • 2
  • 18
  • 35

0 Answers0