2

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.

1 Answer 1

11
\documentclass[border=10pt,pstricks]{standalone}
\usepackage{pst-node,pst-plot,pst-eucl,multido}

\begin{document}
\multido{\iA=0+6,\iB=1+1}{60}{%
\begin{pspicture}(-5.2,-5.2)(5.5,2.5)
    \pnode(0,0){O}
    \psaxes[linewidth=0.5pt]{->}(0,0)(-5,-5)(5,2)[$x$,0][$y$,90]
    \rput{\iA}(0,-3){\pnodes(-4,0){A}(4,0){B}\psline(A)(B)}
    \pnode(!\iA\space tan dup 0 eq { -3 0 }{1 exch div neg 5 mul 5} ifelse exch){C}
    \pstInterLL{A}{B}{O}{C}{D}
    \pnode(0,0){Aa}
    \multido{\iC=0+6}{\iB}{%
      \rput{\iC}(0,-3){\pnodes(-4,0){Ab}(4,0){Bb}}%
      \pnode(!\iC\space tan dup 0 eq { -3 0 }{1 exch div neg 5 mul 5} ifelse exch){Cb}%
      \pstInterLL[PointSymbol=none,PointName=none]{Ab}{Bb}{O}{Cb}{Db}%
      \psline(Aa)(Db)\pnode(Db){Aa}}%
    \psline[linestyle=dashed](0,0)(D)
\end{pspicture}%
}
\end{document}

Converted into a gif with:

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

enter image description here

7
  • I also need a coordinate axis.
    – Student
    Commented Mar 25, 2014 at 13:40
  • see edited answer
    – user2478
    Commented Mar 25, 2014 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
    Commented Mar 25, 2014 at 13:58
  • @Student: Which is the rotation point of the line?
    – user2478
    Commented Mar 25, 2014 at 14:12
  • line y=-3, and the rotation point is (0,-3). Thanks.
    – Student
    Commented Mar 25, 2014 at 14:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.