#define NUM_ZEROS 2 Complex zeros[NUM_ZEROS]={{10.0,0},{-30,0}}; #define NUM_POLES 2 Complex poles[NUM_POLES]={{-20.0,-15.0},{-20.0,15.0}}; F64 scale; Complex *PoleZeroFind(I64 x,I64 y) { I64 i; F64 d,best_d=MAX_F64; Complex *result=NULL; for (i=0;iwin_pixel_width,h=task->win_pixel_height,cx=w/2,cy=h/2, lo=Gs->num*h/mp_cnt,hi=(Gs->num+1)*h/mp_cnt; F64 yy,y_total=0; CDC *dc=DCAlias(gr_dc,task); for (y=lo;ycolor=Limit(yy,0,14); y_total+=Limit(yy,-14,14); GrPlot(dc,x,y); } } DCDel(dc); return y_total; } U0 Draw() { CSrvCmd *tempm[MP_MAX_PROCESSORS]; F64 y_total,old_y_total=MAX_F64; I64 i,w=Fs->win_pixel_width,h=Fs->win_pixel_height,cx=w/2,cy=h/2; CDC *dc=DCAlias; while (TRUE) { for (i=0;icolor=15; GrLine(dc,0,cy,w,cy); GrLine(dc,cx,0,cx,h); for (i=0;iwin_inhibit=WIF_ALL-WIF_BORDER; SetVGAPalette4(vga_palette4_gray); SetVGAPaletteColor(15,0xFF0000); //White is red WinMax; WordStat; WinBorder; DCFill; DocClear; scale=1.0; try { Draw; while (TRUE) { msg_code=GetMsg(&p1,&p2,1<win_pixel_width/2; cy=Fs->win_pixel_height/2; switch (msg_code) { case MSG_IP_L_DOWN: tempc=PoleZeroFind(p1-cx,cy-p2); break; case MSG_IP_MOVE: if (tempc) { p11=p1;p22=p2; //get to last mouse move while (msg_code=ScanMsg(&p1,&p2,1<x=p11-cx; tempc->y=cy-p22; Draw; } break; case MSG_IP_L_UP: if (tempc) { tempc->x=p1-cx; tempc->y=cy-p2; tempc=NULL; Draw; } break; case MSG_IP_R_DOWN: case MSG_IP_R_UP: Draw; break; case MSG_KEY_DOWN: if (p1==CH_SHIFT_ESC||p1==CH_ESC) goto pz_done; } WinMgrSync; } pz_done: GetMsg(,,1<