1
$\begingroup$

I have some problems with animation of two functions. I want to add another function to this code:

Animate[
 Graphics[Line[{{0, 0}, {Cos[x], Sin[x]}}], Axes -> True, 
  PlotRange -> {{-5, 5}, {-5, 5}}], {x, 0, 2 Pi}]

This function should depend on x too. Please, help me.

$\endgroup$
1
$\begingroup$
Animate[Graphics[{Red, 
   Line[{{{0, 0}, {Cos[x], Sin[x]}}, {{Sin[x], Cos[x]}, {Cos[x], 
       Sin[x]}, {{1, 1}, {2, 2}}}, {{0, 0}, {Sin[x], Cos[x]}}}]}, Axes -> True, 
  PlotRange -> {{-5, 5}, {-5, 5}}], {x, 0, 2 Pi}]

Line can take multiple points to render independently. You could also create a line-strip without specifying the points in a separate list. I suggest your read trhough the documentation of Line.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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