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.

=================

=================

1 Answer

1

=================

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]}]