/* * dcvertical.c Jim Piper 23-01-87 * from OS9 version of "vertical.c" 20-05-86 * * * Modifications * * 11 Sep 1986 CAS Includes * JP 14/05/86 "fipconvhull" used for FIP digitised objects */ #include #include #include #include #define RADIANS 57.296 struct chromosome *dcvertical(obj,FIP) struct chromosome *obj; { struct object *cvh, *convhull(), *fipconvhull(); struct chromosome *robj, *spinsqueeze(); struct chromplist *plist; struct frect *rdom; struct chord *ch; int i,j,k,n1,n2,s,c; double xscale,yscale,doubtemp; xscale = 1.0; if (FIP) { yscale = 0.75; cvh = fipconvhull(obj); } else { yscale = 1.0; cvh = convhull(obj); } mwrangle(cvh,&ch,&n1,&n2,&s,&c); if (c == 0) { c = 1; s *= 1000; } doubtemp = atan((double)s / c); robj = spinsqueeze(obj,doubtemp,xscale,yscale); /* * fill in the property list */ doubtemp = RADIANS*doubtemp; /* angle through which I have been rotated */ obj->plist->rangle = (int) doubtemp; freeobj(cvh); return(robj); }