%!
(lenses.ps) run
72 72 scale
0.02 setlinewidth
2 2 translate

newpath
0 0 moveto
6 0 lineto
6 6 lineto
0 6 lineto
closepath
clip

newpath
1 0 moveto
6 0 lineto
6 5 lineto
0 0.8 0.9 setrgbcolor
fill

newpath
5 1 moveto
2 4 lineto
0 0 0 setrgbcolor
stroke


newpath
0 3.5 moveto
3.5 2.5 lineto
1 0 0 setrgbcolor
stroke


/Vo [3.5 0 sub 2.5 3.5 sub] def
/Vn Vo normalized def
/si Vn 0 get 1 2 sqrt div mul Vn 1 get 1 2 sqrt div mul add def
/n 1.33 def
/r si n div asin def
/v [r cos 1 mul r sin 1 mul add r cos -1 mul r sin 1 mul add] def


newpath
3.5 2.5 moveto
3.5 2.5 translate
2 v 0 get mul 2 v 1 get mul lineto
stroke


newpath
0 0 0.5 135 135 si asin add arc
1 0.5 0 setrgbcolor
stroke
0 0 0.5 315 315 r add arc
stroke


showpage