| 272 |
|
d = DOT(disp,v->hvec); |
| 273 |
|
d2 = DOT(disp,v->vdir); |
| 274 |
|
ip[0] = 180.0/PI * atan2(d,d2) / v->horiz + 0.5 - v->hoff; |
| 275 |
< |
d = d*d + d2*d2; |
| 276 |
< |
if (d <= FTINY*FTINY) |
| 275 |
> |
d2 = d*d + d2*d2; |
| 276 |
> |
if (d2 <= FTINY*FTINY) |
| 277 |
|
return(VL_BAD); /* at pole */ |
| 278 |
< |
if ((v->vaft > FTINY) & (d >= v->vaft*v->vaft)) |
| 278 |
> |
if ((v->vaft > FTINY) & (d2 >= v->vaft*v->vaft)) |
| 279 |
|
rflags |= VL_BEYOND; |
| 280 |
< |
d = 1.0/sqrt(d); |
| 280 |
> |
d = 1.0/sqrt(d2); |
| 281 |
|
ip[1] = DOT(disp,v->vvec)*d/v->vn2 + 0.5 - v->voff; |
| 282 |
|
ip[2] = VLEN(disp); |
| 283 |
|
ip[2] *= (1.0 - v->vfore*d); |
| 386 |
|
char *av[] |
| 387 |
|
) |
| 388 |
|
{ |
| 389 |
< |
#define check(c,l) if ((av[0][c]&&av[0][c]!=' ') || \ |
| 389 |
> |
#define check(c,l) if ((av[0][c]&&!isspace(av[0][c])) || \ |
| 390 |
|
badarg(ac-1,av+1,l)) return(-1) |
| 391 |
|
|
| 392 |
|
if (ac <= 0 || av[0][0] != '-' || av[0][1] != 'v') |
| 393 |
|
return(-1); |
| 394 |
|
switch (av[0][2]) { |
| 395 |
|
case 't': /* type */ |
| 396 |
< |
if (!av[0][3] || av[0][3]==' ') |
| 396 |
> |
if (!av[0][3] || isspace(av[0][3])) |
| 397 |
|
return(-1); |
| 398 |
|
check(4,""); |
| 399 |
|
v->type = av[0][3]; |
| 578 |
|
} |
| 579 |
|
/* skip leading path */ |
| 580 |
|
cp = s; |
| 581 |
< |
while (*cp && *cp != ' ') |
| 581 |
> |
while (*cp && !isspace(*cp)) |
| 582 |
|
cp++; |
| 583 |
|
while (cp > s && !ISDIRSEP(cp[-1])) |
| 584 |
|
cp--; |
| 630 |
|
if (rp != NULL && !fgetsresolu(rp, fp)) |
| 631 |
|
mvs.ok = 0; |
| 632 |
|
|
| 633 |
< |
fclose(fp); |
| 633 |
> |
if (fp != stdin) |
| 634 |
> |
fclose(fp); |
| 635 |
|
|
| 636 |
|
return(mvs.ok); |
| 637 |
|
} |