#include #include #include #include "driver.h" void tick(void) { int i; double x; double y; int ix; int iy; int pix; int piy; unsigned int tv; if (npar < 3) { printf("need three parameters\n"); exit(1); } tv = winh - 1; while (tv & (tv + 1)) tv |= tv + 1; XSetFunction(disp,bitgc,GXcopy); XSetForeground(disp,bitgc,0); XFillRectangle(disp,pic,bitgc,0,0,winw,winh); XSetForeground(disp,bitgc,1); for (i=0;i<=pars[2];i++) { x = cos((i*pars[0]*2)*M_PI/pars[2]); y = sin((((i*pars[1]*2)*M_PI)+t)/pars[2]); ix = ((x+1) * (winw-1)) / 2; iy = ((y+1) * (winh-1)) / 2; if (i) XDrawLine(disp,pic,bitgc,pix,piy,ix,iy); pix = ix; piy = iy; } }