| 14 |
|
|
| 15 |
|
#include "platform.h" |
| 16 |
|
#include "rtio.h" |
| 17 |
< |
#include "rtprocess.h" |
| 17 |
> |
#include "paths.h" |
| 18 |
|
#include "fvect.h" |
| 19 |
|
|
| 20 |
|
#ifdef M_PI |
| 23 |
|
#define PI 3.14159265358979323846 |
| 24 |
|
#endif |
| 25 |
|
|
| 26 |
– |
#define FEQ(a,b) ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7) |
| 27 |
– |
|
| 26 |
|
#define MAXVERT 6 /* maximum number of vertices for markers */ |
| 27 |
|
#define MAXMARK 128 /* maximum number of markers */ |
| 28 |
|
|
| 183 |
|
exit(1); |
| 184 |
|
} |
| 185 |
|
convert(buf, pin); |
| 186 |
< |
pclose(pin); |
| 186 |
> |
if (pclose(pin) != 0) { |
| 187 |
> |
fprintf(stderr, |
| 188 |
> |
"%s: (%s): bad status from \"%s\"\n", |
| 189 |
> |
progname, fname, buf); |
| 190 |
> |
exit(1); |
| 191 |
> |
} |
| 192 |
|
} else |
| 193 |
|
printf("\n%s\n", buf); |
| 194 |
|
} |
| 404 |
|
} |
| 405 |
|
n = 0; |
| 406 |
|
theta = atan2(yp[2], zp[2]); |
| 407 |
< |
if (!FEQ(theta,0.0)) { |
| 407 |
> |
if (!FABSEQ(theta,0.0)) { |
| 408 |
|
sprintf(xf, " -rx %f", theta*(180./PI)); |
| 409 |
|
while (*xf) ++xf; |
| 410 |
|
n += 2; |
| 411 |
|
} |
| 412 |
< |
theta = asin(-xp[2]); |
| 413 |
< |
if (!FEQ(theta,0.0)) { |
| 412 |
> |
theta = Asin(-xp[2]); |
| 413 |
> |
if (!FABSEQ(theta,0.0)) { |
| 414 |
|
sprintf(xf, " -ry %f", theta*(180./PI)); |
| 415 |
|
while (*xf) ++xf; |
| 416 |
|
n += 2; |
| 417 |
|
} |
| 418 |
|
theta = atan2(xp[1], xp[0]); |
| 419 |
< |
if (!FEQ(theta,0.0)) { |
| 419 |
> |
if (!FABSEQ(theta,0.0)) { |
| 420 |
|
sprintf(xf, " -rz %f", theta*(180./PI)); |
| 421 |
|
/* while (*xf) ++xf; */ |
| 422 |
|
n += 2; |