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.11 by greg, Thu May 7 21:38:35 2009 UTC vs.
Revision 2.12 by greg, Sun Sep 26 15:42:48 2010 UTC

# Line 119 | Line 119 | FVECT  v
119          if (d == 0.0)
120                  return(0.0);
121          
122 <        if (d <= 1.0+FTINY && d >= 1.0-FTINY)
122 >        if (d <= 1.0+FTINY && d >= 1.0-FTINY) {
123                  len = 0.5 + 0.5*d;      /* first order approximation */
124 <        else
124 >                d = 2.0 - len;
125 >        } else {
126                  len = sqrt(d);
127 <
128 <        v[0] *= d = 1.0/len;
127 >                d = 1.0/len;
128 >        }
129 >        v[0] *= d;
130          v[1] *= d;
131          v[2] *= d;
132  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines