--- ray/src/px/pcond4.c 1996/10/04 16:10:43 3.3 +++ ray/src/px/pcond4.c 1996/10/04 18:11:52 3.5 @@ -99,8 +99,11 @@ compveil() /* compute veiling image */ t2 = DOT(rdirscan(py)[px], rdirscan(y)[x]); if (t2 <= FTINY) continue; + /* use approximation instead t2 = acos(t2); t2 = 1./(t2*t2); + */ + t2 = .5 / (1. - t2); copycolor(ctmp, fovscan(y)[x]); scalecolor(ctmp, t2); addcolor(vsum, ctmp); @@ -177,7 +180,12 @@ double La; }; double l10La; register int i; - /* interpolate/extrapolate data */ + /* check limits */ + if (La <= 7.85e-4) + return(resfreq[0]); + if (La >= 1.78e3) + return(resfreq[NPOINTS-1]); + /* interpolate data */ l10La = log10(La); for (i = 0; i < NPOINTS-2 && l10lum[i+1] <= l10La; i++) ; @@ -355,9 +363,10 @@ initacuity() /* initialize variable acuity sampling } fcross(cp, diffx, diffy); omega = 0.5 * sqrt(DOT(cp,cp)); - tsampr(x,y) = PI/180. / sqrt(omega) / - hacuity(plum(fovscan(y)[x])); - if (tsampr(x,y) > maxsr) + if (omega <= FTINY) + tsampr(x,y) = 1.; + else if ((tsampr(x,y) = PI/180. / sqrt(omega) / + hacuity(plum(fovscan(y)[x]))) > maxsr) maxsr = tsampr(x,y); } /* copy perimeter (easier) */