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

Comparing ray/src/util/rsensor.c (file contents):
Revision 2.10 by greg, Thu May 19 16:09:38 2011 UTC vs.
Revision 2.11 by greg, Mon Jun 20 23:08:43 2011 UTC

# Line 470 | Line 470 | sens_val(
470          int     t, p;
471          
472          dv[2] = DOT(dvec, ourview.vdir);
473 <        theta = (float)((1./DEGREE) * acos(dv[2]));
473 >        theta = acos(dv[2]);
474          if (theta >= maxtheta)
475                  return(.0f);
476          dv[0] = DOT(dvec, ourview.hvec);
477          dv[1] = DOT(dvec, ourview.vvec);
478 <        phi = (float)((1./DEGREE) * atan2(-dv[0], dv[1]));
479 <        while (phi < .0f) phi += 360.f;
478 >        phi = atan2(-dv[0], dv[1]);
479 >        while (phi < .0f) phi += (float)(2.*PI);
480          t = (int)(theta/maxtheta * sntp[0]);
481 <        p = (int)(phi*(1./360.) * sntp[1]);
481 >        p = (int)(phi*(1./(2.*PI)) * sntp[1]);
482                          /* hack for non-uniform sensor grid */
483 +        theta *= (float)(1./DEGREE);
484 +        phi *= (float)(1./DEGREE);
485          while (t+1 < sntp[0] && theta >= s_theta(t+1))
486                  ++t;
487          while (t-1 >= 0 && theta <= s_theta(t-1))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines