| 1 |
– |
/* Copyright (c) 1991 Regents of the University of California */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* xf.c - routines to convert transform arguments into 4X4 matrix. |
| 6 |
|
* |
| 7 |
< |
* 1/28/86 |
| 7 |
> |
* External symbols declared in rtmath.h |
| 8 |
|
*/ |
| 9 |
|
|
| 10 |
< |
#include "standard.h" |
| 10 |
> |
#include <stdlib.h> |
| 11 |
> |
#include "rtmath.h" |
| 12 |
> |
#include "rtio.h" |
| 13 |
|
|
| 14 |
|
#define d2r(a) ((PI/180.)*(a)) |
| 15 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
int |
| 20 |
< |
xf(ret, ac, av) /* get transform specification */ |
| 22 |
< |
register XF *ret; |
| 23 |
< |
int ac; |
| 24 |
< |
char *av[]; |
| 20 |
> |
isxfopt(char *p) /* check whether option begins transform */ |
| 21 |
|
{ |
| 22 |
+ |
if (*p++ != '-') |
| 23 |
+ |
return(0); |
| 24 |
+ |
|
| 25 |
+ |
if ((p[0] == 't') | (p[0] == 's') | (p[0] == 'i') && |
| 26 |
+ |
!p[1]) |
| 27 |
+ |
return(1); |
| 28 |
+ |
|
| 29 |
+ |
if ((p[0] == 'r') | (p[0] == 'm') && |
| 30 |
+ |
('x' <= p[1]) & (p[1] <= 'z') && |
| 31 |
+ |
!p[2]) |
| 32 |
+ |
return(1); |
| 33 |
+ |
|
| 34 |
+ |
return(0); |
| 35 |
+ |
} |
| 36 |
+ |
|
| 37 |
+ |
|
| 38 |
+ |
int |
| 39 |
+ |
xf(XF *ret, int ac, char *av[]) /* get transform specification */ |
| 40 |
+ |
{ |
| 41 |
|
MAT4 xfmat, m4; |
| 42 |
|
double xfsca, dtmp; |
| 43 |
|
int i, icnt; |
| 147 |
|
|
| 148 |
|
|
| 149 |
|
int |
| 150 |
< |
invxf(ret, ac, av) /* invert transform specification */ |
| 136 |
< |
register XF *ret; |
| 137 |
< |
int ac; |
| 138 |
< |
char *av[]; |
| 150 |
> |
invxf(XF *ret, int ac, char *av[]) /* invert transform specification */ |
| 151 |
|
{ |
| 152 |
|
MAT4 xfmat, m4; |
| 153 |
|
double xfsca, dtmp; |
| 258 |
|
|
| 259 |
|
|
| 260 |
|
int |
| 261 |
< |
fullxf(fx, ac, av) /* compute both forward and inverse */ |
| 250 |
< |
FULLXF *fx; |
| 251 |
< |
int ac; |
| 252 |
< |
char *av[]; |
| 261 |
> |
fullxf(FULLXF *fx, int ac, char *av[]) /* compute both forward and inverse */ |
| 262 |
|
{ |
| 263 |
|
xf(&fx->f, ac, av); |
| 264 |
|
return(invxf(&fx->b, ac, av)); |