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

Comparing ray/src/common/fvect.c (file contents):
Revision 2.16 by greg, Thu Nov 8 00:31:17 2012 UTC vs.
Revision 2.17 by greg, Thu Nov 22 06:07:17 2012 UTC

# Line 195 | Line 195 | int meas               /* distance measure (radians, absolute, rela
195   )
196   {
197          FVECT   normtarg;
198 <        double  volen, dotprod, sint, cost;
198 >        double  volen, dotprod, sintr, cost;
199          int     i;
200  
201          VCOPY(normtarg, vtarg);         /* in case vtarg==vres */
# Line 222 | Line 222 | int meas               /* distance measure (radians, absolute, rela
222          else if (meas == GEOD_REL)
223                  t *= acos(dotprod);
224          cost = cos(t);
225 <        sint = sin(t);
225 >        sintr = sin(t) / sqrt(1. - dotprod*dotprod);
226          for (i = 0; i < 3; i++)
227                  vres[i] = volen*( cost*vres[i] +
228 <                                  sint*(normtarg[i] - dotprod*vres[i]) );
228 >                                  sintr*(normtarg[i] - dotprod*vres[i]) );
229  
230          return(volen);                  /* return vector length */
231   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines