; This shows the dispersion of light through an isosceles prism. ; nell prism.nll START 3 | nellsvg 4 2 in 0.02 1 > prism.svg n0 = 1; air index of refraction n1 = 1.6; prism index of refraction phi = pi/3; apex angle psi = (pi-phi)/2; base interior angle a = (pi+phi)/2; base exterior angle s = 2; length of the two equal sides sb = 2*s*sin(phi/2); length of base h = 1; ray entrance height above base max=s*sin(psi) x = h/cos(phi/2); t0 = pi/4; ray entrance angle, horizontal=phi/2 t1 = asin(n0*sin(t0)/n1); t2 = phi-t1; t3 = asin(n1*sin(t2)/n0); l0 = (s-x)*sin(phi)/cos(t2); PRISM : ; CALC : A(n1,n1-0.1) A(t1,asin(n0*sin(t0)/n1)) A(t2,phi-t1) A(t3,asin(n1*sin(t2)/n0)) A(l0,(s-x)*sin(phi)/cos(t2)); RAY : [T(t1-pi/2) L(l0) T(t2-t3) L(2)] S(CALC,1); START : M(0.5) S(PRISM,1) T(psi) M(x) [T(pi/2+t0) L(1)] S(RAY,4);