apwidth=800; apheight=600; npoles=3; poles[0]= [ 1,0]; poles[1]= [ 1,0]; poles[2]= [ 0,0]; nzeros=2; zeros[0]= [-1,0]; zeros[1]= [.5,0]; var dz=.04; var z= [ 0,0]; var segmid=[0,0]; var dgain=[0,0]; var oldgain=[0,0]; var segment=[0,0]; Cream=[255,255,239]; function Blob(x,c){ Colour(c); BoxFill(x[0]-dz/2,x[1]+dz/2,x[0]+dz/2,x[1]-dz/2); } function Blip(x,c){ Colour(c); BoxFill(x[0]-dz/4,x[1]+dz/4,x[0]+dz/4,x[1]-dz/4); } function Showroots(){ for(i=0;i
0){ segment[0]=dz*dgain[0]/mod; segment[1]=-dz*dgain[1]/mod; }else{ segment=[0,0]; } } function circle(){ Colour(Black); LineStart(1,0); for(i=0;i<6.283;i+=.05){ LineTo(Math.cos(i),Math.sin(i)); } } InitGraph(); ScaleWindow(-1.6,-1.2,1.6,1.2); DrawAxes(); Showroots(); circle(); Colour(Black); for(z[1]=-2.38;z[1]<2.4;z[1]+=dz){ segmid[1]=z[1]; oldgain[1]=0; for(z[0]=-4.98;z[0]<1.4;z[0]+=dz){ getgain(z); if((gain[1]*oldgain[1]<0)&&(gain[0]<0)){ csub(dgain,gain,oldgain); getsegment(); segmid[0]=z[0]-dz*gain[1]/dgain[1]; LineStart(segmid[0]-segment[0]/2,segmid[1]-segment[1]/2); LineTo(segmid[0]+segment[0]/2,segmid[1]+segment[1]/2); } copy(gain,oldgain); } } for(z[0]=-4.98;z[0]<1.4;z[0]+=dz){ segmid[0]=z[0]; oldgain[1]=0; for(z[1]=-2.38;z[1]<2.4;z[1]+=dz){ getgain(z); if((gain[1]*oldgain[1]<0)&&(gain[0]<0)){ csub(dgain,gain,oldgain); getsegment(); segmid[1]=z[1]-dz*gain[1]/dgain[1]; LineStart(segmid[0]+segment[1]/2,segmid[1]-segment[0]/2); LineTo(segmid[0]-segment[1]/2,segmid[1]+segment[0]/2); } copy(gain,oldgain); } } Label('Unit circle',-.8,.5);