TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make an animation of line y=-3 that rotates by angle $\phi$ and the perpendicular distance from origin to this line. I also need to trace the shape that points of the intersection of the line with the perpendicular line makes.

Sorry, I forgot to mention that I also need a coordinate axes.

share|improve this question
up vote 11 down vote accepted

    \pnode(!\iA\space tan dup 0 eq { -3 0 }{1 exch div neg 5 mul 5} ifelse exch){C}
      \pnode(!\iC\space tan dup 0 eq { -3 0 }{1 exch div neg 5 mul 5} ifelse exch){Cb}%

Converted into a gif with:

convert -delay 50 -loop 0 -density 200 -scale 350 -alpha remove test.pdf test.gif

enter image description here

share|improve this answer
I also need a coordinate axis. – Student Mar 25 '14 at 13:40
see edited answer – Herbert Mar 25 '14 at 13:52
This is line y=0, can you please change it to y=-3. and there is no perpendicular line from origin to the line in your solution. – Student Mar 25 '14 at 13:58
@Student: Which is the rotation point of the line? – Herbert Mar 25 '14 at 14:12
line y=-3, and the rotation point is (0,-3). Thanks. – Student Mar 25 '14 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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