221 |
|
y *= sqrt(v->vn2); |
222 |
|
d = x*x + y*y; |
223 |
|
z = (1. - d)/(1. + d); |
224 |
< |
d = d <= FTINY*FTINY ? PI : sqrt((1.0 - z*z)/d); |
225 |
< |
x *= d; |
226 |
< |
y *= d; |
224 |
> |
x *= (1. + z); |
225 |
> |
y *= (1. + z); |
226 |
|
direc[0] = z*v->vdir[0] + x*v->hvec[0] + y*v->vvec[0]; |
227 |
|
direc[1] = z*v->vdir[1] + x*v->hvec[1] + y*v->vvec[1]; |
228 |
|
direc[2] = z*v->vdir[2] + x*v->hvec[2] + y*v->vvec[2]; |
307 |
|
return; |
308 |
|
if (d <= -(1.0-FTINY)) |
309 |
|
return; /* really an error */ |
310 |
< |
d = sqrt(1.0 - d*d) / (1.0 + d); |
311 |
< |
ip[0] += DOT(disp,v->hvec)*d/sqrt(v->hn2); |
313 |
< |
ip[1] += DOT(disp,v->vvec)*d/sqrt(v->vn2); |
310 |
> |
ip[0] += DOT(disp,v->hvec)/((1. + d)*sqrt(v->hn2)); |
311 |
> |
ip[1] += DOT(disp,v->vvec)/((1. + d)*sqrt(v->vn2)); |
312 |
|
return; |
313 |
|
} |
314 |
|
ip[0] = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff; |
352 |
|
{ |
353 |
|
int x, y; |
354 |
|
|
355 |
< |
x = (lx >= 0.0) ? (int)(lx * rp->xr) : -(int)(-lx * rp->xr); |
356 |
< |
y = (ly >= 0.0) ? (int)(ly * rp->yr) : -(int)(-ly * rp->yr); |
355 |
> |
x = (int)(lx*rp->xr + .5 - (lx < 0.0)); |
356 |
> |
y = (int)(ly*rp->yr + .5 - (ly < 0.0)); |
357 |
> |
|
358 |
|
if (rp->rt & XDECR) |
359 |
|
x = rp->xr-1 - x; |
360 |
|
if (rp->rt & YDECR) |