5
$\begingroup$

I'm trying to create a complicated animated plot. The idea is to have a 3D helix, that is a projection of a point moving in a circle. Then the helix would de-convolute in a cosine and sine, similar to the following picture.

enter image description here

So far I can make a 3d helix but I don't know how to put everything together.

This is the code for the helix and this is what I get.

Animate[Module[{a}, 
  Show[ParametricPlot3D[a = {Cos[t], Sin[t], t/4}, {t, 0, u}, 
    ImageSize -> Small, PlotRange -> {{-2, 2}, {-2, 2}, {0, 8}}], 
   Graphics3D[{Red, Sphere[a, 0.15]}]]], {u, 10.^-6, 30}, 
 AnimationRate -> 3]

enter image description here

Any idea on to do the animated plot?

$\endgroup$

1 Answer 1

7
$\begingroup$

You can combine multiple ParametricPlot3Ds. Here is something to begin with:

tRange = 5;
ω = 2;
offset = 1.2;

Animate[Show[
  ParametricPlot3D[{t + δ, Cos[ω t + δ], Sin[ω t + δ]}, {t, -tRange, 0}, 
   BoxRatios -> Automatic, PlotRange -> {{δ - tRange, δ + tRange}, 
    {-offset - .1, offset + .1}, {-offset - .1, offset + .1}}, Boxed -> True,
   Axes -> False, PlotStyle -> ColorData[97][3], Lighting -> "Neutral",
   ViewProjection -> "Ortographic"], 
  ParametricPlot3D[{{t + δ, Cos[ω t + δ], -offset}, 
   {t + δ, offset, Sin[ω t + δ]}}, 
   {t, 0, 20}, PlotStyle -> {Darker@Blue, Darker@Red}],
  ParametricPlot3D[{δ, Cos[ϕ], Sin[ϕ]}, {ϕ, 0, 2 Pi}, PlotStyle -> {Gray}], 
  Graphics3D[{Opacity[.9, White], Polygon[{{δ, -offset, -offset}, {δ, 
       offset, -offset}, {δ, offset, offset}, {δ, -offset, offset}}], Yellow, 
    Sphere[{δ, Cos[δ], Sin[δ]}, .12], Darker@Blue, 
    Line[{{δ, Cos[δ], Sin[δ]}, {δ, Cos[δ], -offset}}], Darker@Red, 
    Line[{{δ, Cos[δ], Sin[δ]}, {δ, offset, Sin[δ]}}]
  }]], {δ, 10 Pi, 0}]

Plot

You can use FaceGrids -> {{0, 1, 0}, {0, 0, -1}} but this will show the grids across whole faces. You can use Boxed -> False, and then manually draw the box only on the left half.

$\endgroup$
0

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.