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.2 by greg, Fri Oct 2 16:02:43 1992 UTC vs.
Revision 2.3 by greg, Fri Dec 10 09:53:30 1993 UTC

# Line 103 | Line 103 | register FVECT  v;
103          if (len <= 0.0)
104                  return(0.0);
105          
106 <        /****** problematic
107 <        if (len >= (1.0-FTINY)*(1.0-FTINY) &&
108 <                        len <= (1.0+FTINY)*(1.0+FTINY))
109 <                return(1.0);
110 <        ******/
106 >        if (len <= 1.0+FTINY && len >= 1.0-FTINY)
107 >                len = 0.5 + 0.5*len;    /* first order approximation */
108 >        else
109 >                len = sqrt(len);
110  
112        len = sqrt(len);
111          v[0] /= len;
112          v[1] /= len;
113          v[2] /= len;
114 +
115          return(len);
116   }
117  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines