! handy-dandy table of maximum angles of incidence for defining coating ranges of angles ! never tried with systems with mirrors ! you'll have to modify for systems with tilted or decentered elements ! Georg Nadorff 4-apr-2002 print print " surf max aoi(+/-) " print "========================" format 8.2 !trace chief ray for entire system: raytrace 0, 1, 0, 0 for s = 1, nsur(), 1 !check to exclude dummy surfaces: if (indx(s) == indx(s-1)) then goto 1 !check if front side or back side of lens: if (indx(s-1) == 1) normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s-1)/rayn(s-1)) vec1(s) = abso(slope - normal) else normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s)/rayn(s)) vec1(s) = abso(slope - normal) endif label 1 next !trace upper marginal chief ray for entire system: raytrace 0, 1, 0, 1 for s = 1, nsur(), 1 !check to exclude dummy surfaces: if (indx(s) == indx(s-1)) then goto 2 !check if front side or back side of lens: if (indx(s-1) == 1) normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s-1)/rayn(s-1)) aoi = abso(slope - normal) else normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s)/rayn(s)) aoi = abso(slope - normal) endif if (aoi > vec1(s)) then vec1(s) = aoi label 2 next !trace lower marginal chief ray for entire system: raytrace 0, 1, 0, -1 for s = 1, nsur(), 1 !check to exclude dummy surfaces: if (indx(s) == indx(s-1)) then goto 3 !check if front side or back side of lens: if (indx(s-1) == 1) normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s-1)/rayn(s-1)) aoi = abso(slope - normal) else normal = 57.29577951*atan(rany(s)/ranz(s)) slope = 57.29577951*atan(raym(s)/rayn(s)) aoi = abso(slope - normal) endif if (aoi > vec1(s)) then vec1(s) = aoi print s, vec1(s) label 3 next