1
$\begingroup$

I've been working on this for a while with little success. I have a point (that needs to be connected to a Manipulate control in some way), that moves up the plot and should appear to move at a different speed in each region.

I was using Trigger with AnimationRunning, and setting the AnimationRate for each (each "region" got its own Control/Trigger) but it doesn't work properly every time.

The point should follow the path of the dashed arrow and the speed it should move at in each region is labeled above the plot.

enter image description here

For some reason I cannot figure this out. Please help.

$\endgroup$

1 Answer 1

4
$\begingroup$

Here's the basic idea, where you can adjust the function, limits, and Piecewise arguments for your specific case.

Manipulate[
 Plot[{120 - 50 x^2, 120 - 50 Sqrt[x]}, {x, 0, 1},
  PlotRange -> {70, 120},
  Filling -> {1 -> {2}},
  PlotStyle -> {Green, Blue},
  FillingStyle -> LightGray,
  Epilog -> {Red, PointSize[0.03], 
    Point[{.5, 
      Piecewise[{{73 a + 70, 0 <= a < .2}, 
                 {13.77 a + 81.85, .2 <= a < 1.9}, 
                 {120 a - 120, 1.9 <= a < 2} }]}]}],
 {{a, 1, " "}, 0, 2, VerticalSlider, ControlPlacement -> Left}]

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.