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

Comparing ray/src/common/interp2d.c (file contents):
Revision 2.5 by greg, Mon Feb 11 23:33:35 2013 UTC vs.
Revision 2.6 by greg, Tue Feb 12 02:56:05 2013 UTC

# Line 238 | Line 238 | interp2_analyze(INTERP2 *ip)
238   static double
239   get_wt(const INTERP2 *ip, const int i, double x, double y)
240   {
241 <        double  dir, rd, d2;
241 >        double  dir, rd, r2, d2;
242          int     ri;
243                                  /* get relative direction */
244          x -= ip->spt[i][0];
# Line 251 | Line 251 | get_wt(const INTERP2 *ip, const int i, double x, doubl
251          rd -= (double)ri;
252          rd = (1.-rd)*ip->da[i][ri] + rd*ip->da[i][(ri+1)%NI2DIR];
253          rd = ip->smf * DECODE_DIA(ip, rd);
254 +        r2 = 2.*rd*rd;
255          d2 = x*x + y*y;
256 +        if (d2 > 21.*r2)        /* result would be < 1e-9 */
257 +                return(.0);
258                                  /* Gaussian times harmonic weighting */
259 <        return( exp(d2/(-2.*rd*rd)) * ip->dmin/(ip->dmin + sqrt(d2)) );
259 >        return( exp(-d2/r2) * ip->dmin/(ip->dmin + sqrt(d2)) );
260   }
261  
262   /* Assign full set of normalized weights to interpolate the given position */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines