1
$\begingroup$

I made this animation:

hh = 3;
ll = 10;
Animate[Graphics[{Thick, Blue, Line[{{0, 0}, {0, hh}}], Thick,  
Green,Line[{{xr, 0}, {xr - (ll*xr)/Sqrt[xr^2 + hh^2], 
(ll*hh)/Sqrt[xr^2 + hh^2]}}]}, Axes -> True], {xr, 3, Sqrt[ll^2 - hh^2]}]

Question: How can I set a fixed domain, for example (-4,10) and how can I make sure that the origin doesn't 'move'? In other words; I want te green line to animate, but the rest should be motionless.

$\endgroup$
1
  • 5
    $\begingroup$ Try adding PlotRange -> {{-4, 10}, {0, 4}} as an option to the Graphics $\endgroup$
    – yarchik
    Commented Jun 22, 2016 at 10:40

1 Answer 1

4
$\begingroup$

See PlotRange

hh = 3;
ll = 10;
Animate[Graphics[{Thick, Blue, Line[{{0, 0}, {0, hh}}]
, Thick, Green
, Line[{{xr, 0}
, {xr - (ll*xr)/Sqrt[xr^2 + hh^2], (ll*hh)/Sqrt[xr^2 + hh^2]}}]}
, Axes -> True
, PlotRange -> {{-4, 10}, {0, 4}}]
, {xr, 3, Sqrt[ll^2 - hh^2]}]

enter image description here

$\endgroup$

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