%! (lenses.inc) run 48 24 scale 1 48 div setlinewidth 4 3 translate 90 rotate %show axis gsave 2 2 translate -3.5 0 moveto 6 0 lineto stroke newpath 0 -3 moveto 0 3 lineto stroke grestore newpath 0.8 0.8 1 setrgbcolor 2 2 1 0 360 arc fill 0 0 0 setrgbcolor 2 2 1 0 360 arc stroke gsave newpath 0.8 0.8 1 setrgbcolor 11.5 2 1.5 290 70 arc fill 0 0 0 setrgbcolor 11.5 2 1.5 290 70 arc stroke grestore gsave newpath 0.8 0.8 1 setrgbcolor 12.5 2 1.5 110 250 arc fill 0 0 0 setrgbcolor 12.5 2 1.5 110 250 arc stroke grestore gsave newpath 0.8 0.8 1 setrgbcolor 17 2 1.5 290 70 arc fill 0 0 0 setrgbcolor 17 2 1.5 290 70 arc stroke grestore gsave newpath 0.8 0.8 1 setrgbcolor 18 2 1.5 110 250 arc fill 0 0 0 setrgbcolor 18 2 1.5 110 250 arc stroke grestore % red ray gsave 1 0 0 setrgbcolor /x 2.9 def /Po [0 x] def /Vo [1 0] def /P1 Po Vo [2 2] 1 hit def 0 x moveto P1 0 get P1 1 get lineto /n [2 2] P1 gradient normalized def /v1 n [1 0] 1.05 refraction def /P2 P1 v1 [2 2] 1 hit def P2 0 get P2 1 get lineto /v2 [1 0] v1 .45 refraction def /p3 P2 v2 [1 0 -12] line-intersection def p3 0 get p3 1 get lineto /v3 [1 0] v2 -.6 refraction def /p4 p3 v3 [1 0 -17.5] line-intersection def p4 0 get p4 1 get lineto /v4 [1 0] v2 1 refraction def /p5 p4 v4 [1 0 -24] line-intersection def p5 0 get p5 1 get lineto stroke grestore gsave 1 0 0 setrgbcolor /x 1.1 def /Po [0 x] def /Vo [1 0] def /P1 Po Vo [2 2] 1 hit def 0 x moveto P1 0 get P1 1 get lineto /n [2 2] P1 gradient normalized def /v1 n [1 0] 1.05 refraction def /P2 P1 v1 [2 2] 1 hit def P2 0 get P2 1 get lineto /v2 [1 0] v1 .45 refraction def /p3 P2 v2 [1 0 -12] line-intersection def p3 0 get p3 1 get lineto /v3 [1 0] v2 -.6 refraction def /p4 p3 v3 [1 0 -17.5] line-intersection def p4 0 get p4 1 get lineto /v4 [1 0] v2 1 refraction def /p5 p4 v4 [1 0 -24] line-intersection def p5 0 get p5 1 get lineto stroke grestore