First: This is not a good headline at all, I know, but nothing clever in this regard comes to me at the moment; sorry!
Now, consider the following MWE:
Code: Select all
\documentclass{article}
\usepackage{auto-pst-pdf,pst-eucl,pstricks-add}
\usepackage{animate}
\usepackage[locale=DE]{siunitx}
\def\radius{21.65}
\def\faktor{0.3333}
\def\vinkelA{12 }
\newcommand*{\light}[1]{%
\pstFPmul\RelRadius\faktor{\radius}
\psset{unit=0.5cm,linecolor=red}
\begin{pspicture}(43,43)
\pnode(0,0){A}
\pnode(!0 \RelRadius){B}
\pnode(!2 \RelRadius\space mul \RelRadius){C}
\pnode(!2 \RelRadius\space mul 0){D}
\pnode(!\RelRadius\space dup){E}
\pscustom[linewidth=2pt,dimen=inner]{%
\psline(A)(D)\psarc(E){\RelRadius}{0}{180}\psline(B)(A)
\closepath
}
\psset{linestyle=none,linecolor=black,dotsep=2pt}
\psRelLine[angle=!270 \vinkelA add](E)(B){1}{P1}
\psRelLine[angle=!270 \vinkelA sub](E)(B){1}{P2}
\psRelLine[angle=!180 #1 sub](P1)(P2){1}{L1}
\psRelLine[angle=!360 #1 sub,linestyle=dotted](P2)(P1){1}{L2}
\psRelLine[angle=!180 #1 sub](P2)(P1){1 \vinkelA cos add 2 \vinkelA sin mul #1 sin mul div}{L3}
\psParallelLine(L2)(L3)(L1){1}{L4}
\begin{psclip}{%
\pscustom[linestyle=none,fillstyle=solid,fillcolor=blue!20]{%
\psline(A)(D)(!\RelRadius\space dup add \RelRadius)
\psarc(E){\RelRadius}{0}{180}\psline(B)(A)
}
}
\pspolygon[fillstyle=solid,fillcolor=yellow](L1)(L2)(L3)(L4)
\end{psclip}
\pspolygon[fillstyle=solid,fillcolor=yellow](L1)(P1)(P2)(L2)
\pnode(!0 1 \vinkelA cos add \RelRadius\space mul){T1}
\pnode(!2 \RelRadius\space mul 1 \vinkelA cos add \RelRadius\space mul){T2}
\pcline[linestyle=dotted](T1)(T2)
\rput(!\RelRadius\space 90 \vinkelA\space sub PtoC){%
\pswedge[linestyle=solid,linewidth=0.5\pslinewidth](P2){0.95}{!180 #1 sub}{180}
\uput{1}[!180 #1 2 div sub](P2){\footnotesize{\SI{#1}{\degree}}}
}
\end{pspicture}
}
\begin{document}
\begin{center}
\begin{animateinline}[poster=first,controls,palindrome]{10}%
\multiframe{121}{iAngle=35+1}{\light{\iAngle}}%
\end{animateinline}%
\end{center}
\end{document}
How do I keep the height constant?
Thank you in advance!
P.S. I compile using
Code: Select all
pdflatex -shell-escape <filename>.tex