# How to change the arrow to another object in pst-optics?

Consider the following example:

%%xelatex
\documentclass[pstricks,crop]{standalone}

\usepackage{pst-optic}

\begin{document}

\begin{pspicture}(-8.5,-3)(8.5,3)
\rput(0,0){\lens[focus=3.333,OA=-10,AB=2,XO=2,xLeft=-8.5,xRight=8.5,rayColor=red]}
\end{pspicture}

\end{document}


How can I change the arrow AB by an image like this: http://www.clipartden.com/_thumbspd/household/candle/candle_lit_blue.png and the arrow A'B' to a correspondingly scaled version of this image?

The image has no transparent colors. The reason why it may make sense to rewdraw the red lines.

\documentclass[pstricks,crop]{standalone}
\usepackage{pst-optic,pst-node,graphicx}

\begin{document}
\begin{pspicture}(-8.5,-3)(8.5,3)
\rput(0,0){%
\lens[focus=3.333,OA=-10,AB=2,XO=2,xLeft=-8.5,xRight=8.5,rayColor=red]%
\pcline[linestyle=none](A)(B)\ncput{\includegraphics[scale=0.2]{candle_lit_blue}}%
\pcline[linestyle=none](A')(B')\ncput{\includegraphics[scale=0.1,angle=180]{candle_lit_blue}}}
\end{pspicture}
\end{document}


• Is there a way such that the image scales automatically if I change the parameters of \lens? – student Jul 11 '16 at 18:42
• yes,that is possible, but not so easy. You can get the coordinates of A,B,A',B' with eg: \psGetNodeCenter{A} But that value is known on PS level but you need it on TeX level, the reason why you have to save it in a file. See also p. 30 of the pst-node documentation – user2478 Jul 11 '16 at 20:12