Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

1 Answer 1

up vote 10 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.