| 1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
| 5 |
|
#endif |
| 6 |
|
|
| 7 |
|
/* |
| 73 |
|
multisamp(spt, 2, urand(ilhash(hlist,3)+dp->n)); |
| 74 |
|
zd = sqrt((dp->t + spt[0])/h->nt); |
| 75 |
|
phi = 2.0*PI * (dp->p + spt[1])/h->np; |
| 76 |
< |
xd = cos(phi) * zd; |
| 77 |
< |
yd = sin(phi) * zd; |
| 76 |
> |
xd = tcos(phi) * zd; |
| 77 |
> |
yd = tsin(phi) * zd; |
| 78 |
|
zd = sqrt(1.0 - zd*zd); |
| 79 |
|
for (i = 0; i < 3; i++) |
| 80 |
|
ar.rdir[i] = xd*h->ux[i] + |
| 84 |
|
rayvalue(&ar); |
| 85 |
|
ndims--; |
| 86 |
|
addcolor(dp->v, ar.rcol); |
| 87 |
< |
if (ar.rt > FTINY && ar.rt < FHUGE) |
| 88 |
< |
dp->r += 1.0/ar.rt; |
| 87 |
> |
/* be conservative and use rot */ |
| 88 |
> |
if (ar.rot > FTINY && ar.rot < FHUGE) |
| 89 |
> |
dp->r += 1.0/ar.rot; |
| 90 |
|
/* (re)initialize error */ |
| 91 |
|
if (dp->n++) { |
| 92 |
|
b2 = bright(dp->v)/dp->n - bright(ar.rcol); |
| 358 |
|
} |
| 359 |
|
mag0 *= 2.0*PI / hp->np; |
| 360 |
|
phi = 2.0*PI * (double)j/hp->np; |
| 361 |
< |
cosp = cos(phi); sinp = sin(phi); |
| 361 |
> |
cosp = tcos(phi); sinp = tsin(phi); |
| 362 |
|
xd += mag0*cosp - mag1*sinp; |
| 363 |
|
yd += mag0*sinp + mag1*cosp; |
| 364 |
|
} |
| 392 |
|
dp += hp->np; |
| 393 |
|
} |
| 394 |
|
phi = 2.0*PI * (j+.5)/hp->np + PI/2.0; |
| 395 |
< |
xd += mag * cos(phi); |
| 396 |
< |
yd += mag * sin(phi); |
| 395 |
> |
xd += mag * tcos(phi); |
| 396 |
> |
yd += mag * tsin(phi); |
| 397 |
|
} |
| 398 |
|
for (i = 0; i < 3; i++) |
| 399 |
|
gv[i] = (xd*hp->ux[i] + yd*hp->uy[i])/(hp->nt*hp->np); |