ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv3.c
(Generate patch)

Comparing ray/src/rt/rv3.c (file contents):
Revision 1.17 by greg, Sun Oct 14 11:06:27 1990 UTC vs.
Revision 1.18 by greg, Tue Mar 19 13:14:03 1991 UTC

# Line 433 | Line 433 | double  zf;
433                  return;
434          }
435   }
436
437
438 spinvector(vres, vorig, vnorm, theta)   /* rotate vector around normal */
439 FVECT  vres, vorig, vnorm;
440 double  theta;
441 {
442        extern double  sin(), cos();
443        double  sint, cost, dotp;
444        FVECT  vperp;
445        register int  i;
446        
447        if (theta == 0.0) {
448                VCOPY(vres, vorig);
449                return;
450        }
451        sint = sin(theta);
452        cost = cos(theta);
453        dotp = DOT(vorig, vnorm);
454        fcross(vperp, vnorm, vorig);
455        for (i = 0; i < 3; i++)
456                vres[i] = vnorm[i]*dotp*(1.-cost) +
457                                vorig[i]*cost + vperp[i]*sint;
458 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines