0

why does the following code not work?

r = {2.30 Cos[5s], -2.30 Sin[5s]};

Manipulate[ParametricPlot[{Sin[3 t], Cos[2 t]}, {t, 0, 2 Pi}, 
PlotRange -> {{-r[[1]] , r[[1]]}, {-r[[2]] , r[[2]]}}], {s, 0.1, 2 Pi, 0.01}]

but if I put r[[1]] and r[[2]] by hand it works

Manipulate[ParametricPlot[{Sin[3 t], Cos[2 t]}, {t, 0, 2 Pi}, 
PlotRange -> {{-2.3 Cos[5 s],2.3 Cos[5 s]}, {2.3 Sin[5 s] , -2.3 Sin[5 s]}}]
,{s, 0.1, 2 Pi,0.01}]
vito
  • 8,958
  • 1
  • 25
  • 67

1 Answers1

0

Try this:

f[s_] := {2.30 Cos[5 s], -2.30 Sin[5 s]};
Manipulate[
ParametricPlot[{Sin[3 t], Cos[2 t]}, {t, 0, 2 Pi}, 
PlotRange -> {{-f[s][[1]], f[s][[1]]}, {-f[s][[2]], f[s][[2]]}}],
{s, 0.1, 2 Pi, 0.01}
]
Tugrul Temel
  • 6,193
  • 3
  • 12
  • 32