2
$\begingroup$

Assume that G defined by:

G = {Sqrt[1 - x] + I Sqrt[x], Sqrt[1 - x] - I Sqrt[x]}

I am trying to create a point that moves along the curves of G from x=0.01 to x=0.99 using manipulate. I'm trying to adapt this code:

Manipulate[Show[ParametricPlot[Evaluate[ReIm /@ G], {x, 0.01, y}, AxesLabel -> (Style[#, 12, Bold] & /@ {Re, Im}),PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}}, PlotLegends -> Placed[G, Right]], Graphics@{Dotted, Circle[{0, 0}, 1]}], Row[{Control[{{y, 0.011, "x"}, 0.011, 0.99,Slider[##, Appearance -> "Labeled"] &}], Control[{{y, 0.011, ""}, 0.011, 0.99, Animator[##, AnimationRunning -> False, AppearanceElements -> {"StepLeftButton", "StepRightButton", "PlayPauseButton", "DirectionButton"}] &}]}]]

This gives a rising curves between the values of x. I want to show the curves with a moving points of x-values along them. As the example here

Create a moving plot along a parametric plot using Manipulate?

but in 2D.

$\endgroup$
2

2 Answers 2

3
$\begingroup$

I used Epilog inside of ParametricPlot to make the moving point.

Manipulate[Show[
  ParametricPlot[Evaluate[ReIm /@ G], {x, 0.01, y}, 
   AxesLabel -> (Style[#, 12, Bold] & /@ {Re, Im}),
   PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}},
   PlotLegends -> Placed[G, Right],
   Epilog -> {PointSize[Large], Point[Evaluate[ReIm /@ (G /. x -> y)]]}
   ]
  ,
  Graphics@{Dotted, Circle[{0, 0}, 1]}
  ], 
  {y, 0, 1}
 ]

enter image description here

$\endgroup$
2
$\begingroup$
Manipulate[
 ParametricPlot[Evaluate[ReIm /@ G], {x, 0.01, y}, 
  AxesLabel -> (Style[#, 12, Bold] & /@ {Re, Im}), 
  PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}}, MeshFunctions -> {#3 &}, 
  Mesh -> {{y}}, MeshStyle -> Directive[Red, PointSize[Large]], 
  Epilog -> {Dotted, Circle[{0, 0}, 1]}, 
  PlotLegends -> Placed[G, Right]], 
 Row[{Control[{{y, 0.011, "x"}, 0.011, 0.99, 
     Slider[##, Appearance -> "Labeled"] &}], 
   Control[{{y, 0.011, ""}, 0.011, .99, 
     Animator[##, AnimationRunning -> False, 
       AppearanceElements -> {"StepLeftButton", "StepRightButton", 
         "PlayPauseButton", "DirectionButton"}] &}]}]]

enter image description here

$\endgroup$

Your Answer

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

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