1 |
< |
/* Copyright (c) 1996 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 |
|
/* |
368 |
|
d = urand(ilhash(dimlist,ndims)+samplendx); |
369 |
|
multisamp(rv, 2, d); |
370 |
|
d = 2.0*PI * rv[0]; |
371 |
< |
cosp = cos(d); |
372 |
< |
sinp = sin(d); |
371 |
> |
cosp = tcos(d); |
372 |
> |
sinp = tsin(d); |
373 |
|
rv[1] = 1.0 - specjitter*rv[1]; |
374 |
|
if (rv[1] <= FTINY) |
375 |
|
d = 1.0; |
400 |
|
d = urand(ilhash(dimlist,ndims)+1823+samplendx); |
401 |
|
multisamp(rv, 2, d); |
402 |
|
d = 2.0*PI * rv[0]; |
403 |
< |
cosp = cos(d); |
404 |
< |
sinp = sin(d); |
403 |
> |
cosp = tcos(d); |
404 |
> |
sinp = tsin(d); |
405 |
|
rv[1] = 1.0 - specjitter*rv[1]; |
406 |
|
if (rv[1] <= FTINY) |
407 |
|
d = 1.0; |
408 |
|
else |
409 |
< |
d = sqrt( -log(rv[1]) * np->alpha2 ); |
409 |
> |
d = sqrt( np->alpha2 * -log(rv[1]) ); |
410 |
|
for (i = 0; i < 3; i++) |
411 |
|
sr.rdir[i] = np->prdir[i] + d*(cosp*u[i] + sinp*v[i]); |
412 |
|
if (DOT(sr.rdir, r->ron) < -FTINY) { |