dispcand(obj,cpol,cnd,f,c,i) struct chromosome *obj; struct object *cpol; struct cand *cnd; struct pframe *f; { int korig,lorig; struct ivertex *vtx; struct ivector v; struct polygondomain *pdom = (struct polygondomain *)cpol->idom; double angle = - obj->plist->rangle/RADIANS; korig = (obj->idom->kol1 + obj->idom->lastkl)/2; lorig = (obj->idom->line1 + obj->idom->lastln)/2; vtx = pdom->vtx; v.type = 30; v.style = 1; relrotate(vtx->vtX,vtx->vtY,korig,lorig,angle,1.0,1.333,&v.k1,&v.l1); vtx += (pdom->nvertices - 1); relrotate(vtx->vtX,vtx->vtY,korig,lorig,angle,1.0,1.333,&v.k2,&v.l2); intens(i); colour(c); picframe(&v,f); } /* * k, l are integer scaled by 8 !! */ relrotate(k,l,korig,lorig,theta,xscale,yscale,knew,lnew) COORD *knew,*lnew; double theta,xscale,yscale; { double sin(),cos(),s1,s2,c1,c2; l -= lorig*8; k -= korig*8; s1 = sin(theta); c1 = cos(theta); /* modify theta */ theta = atan(yscale*s1/(xscale*c1)); s1 = sin(theta); c1 = cos(theta); s2 = xscale * c1; c2 = - xscale * s1; s1 *= yscale; c1 *= yscale; *lnew = lorig + iround((l*c1 + k*s1)/8.0); *knew = korig + iround((l*c2 + k*s2)/8.0); } iround(d) double d; { if (d >= 0.0) return((int)(d+0.4999)); else return((int)(d-0.4999)); }