%! (lenses.inc) run 72 dup scale 1 72 div setlinewidth 4.25 5.5 translate newpath -2 -2 moveto 2 -2 lineto 2 2 lineto -2 2 lineto closepath clip newpath 0.8 setgray -2 -2 moveto 2 -2 lineto 2 2 lineto -2 2 lineto closepath fill -1 -1 3 sqrt div translate newpath 0.85 0.9 1 setrgbcolor 0 0 moveto 2 0 lineto 1 3 sqrt lineto closepath gsave fill grestore 0 0 0 setrgbcolor stroke newpath gsave 1 1 1 setrgbcolor 0.5 3 sqrt 2 div sub 3 sqrt 2 div 0.5 sub moveto 0.5 3 sqrt 2 div lineto stroke grestore % Snell's Law ni*sini = nr*sinr /x 0.5 def /y 3 sqrt 2 div def % in glass blue light has n = 1.528 % so using i = 60deg, ni =1, nr = 1.528 % r = 34.5253 1 50 div setlinewidth newpath gsave 0 0 1 setrgbcolor x y translate 0 0 moveto -25.5 rotate 0.9 0.4 lineto -25.5 rotate 1.6 1 lineto stroke grestore % in glass red light has n = 1.514 % so using i = 60deg, ni =1, nr = 1.514 % r = 34.8906 newpath gsave 1 0 0 setrgbcolor x y translate 0 0 moveto -25 rotate 0.9 0.4 lineto -25 rotate 1.6 1 lineto stroke grestore % in glass yellow light has n = 1.517 % so using i = 60deg, ni =1, nr = 1.517 % r = 34.8906 newpath gsave 1 1 0.5 setrgbcolor x y translate 0 0 moveto -25.2 rotate 0.9 0.4 lineto -25.2 rotate 1.6 1 lineto stroke grestore 1 1 0.5 setrgbcolor /Times-Bold findfont 0.21 scalefont setfont 2.3 .17 moveto (yellow) show 1 0 0 setrgbcolor /Times-Bold findfont 0.21 scalefont setfont 2.3 .34 moveto (red) show 0 0 1 setrgbcolor /Times-Bold findfont 0.21 scalefont setfont 2.3 0 moveto (blue) show 1 1 1 setrgbcolor /Times-Bold findfont 0.21 scalefont setfont -0.75 .15 moveto (white) show /Times-Bold findfont 0.21 scalefont setfont -0.75 0 moveto (light) show 0 0 0 setrgbcolor /Times-Bold findfont 0.21 scalefont setfont .75 .15 moveto (prism) show