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)) |