discussion with teacher

Thanks. but the wave fronts drawn by pen look funny.
[color=blue][b]made  drawing panel x and y squared==true, should look like the real thing[/b][/color]

There seems to be additional unnecessary wave fronts appearing at the same time.
[color=blue][b]reprogram the pen lines
for( ipen=1;ipen if(vd[ipen]==0 && t>=(ipen-1)*(1/f)){ // clever way to assign wavefront
  count = ipen; // added by lookang to count waves emitted
  tEmitted[ipen] = t;
//  vd[ipen]=4*v; // assign velocity to wavefront
vd[ipen]=4*f*lambda; // assign velocity to wavefront
  xs[ipen]=xsource; // assign position
for( ipen2=1;ipen2 if(vd2[ipen2]==0 && t>=(phase/(2*pi)+ipen2-1)*(1/f2)&&t>=0){ // clever way to assign wavefront
  count2 = ipen2; // added by lookang to count waves emitted
  tEmitted2[ipen2] = t;
  vd2[ipen2]=4*f2*lambda2; // assign velocity to wavefront
  xs2[ipen2]=xsource2; // assign position
if (phase>0&&t==0)vd2[1]=0; // needed to fix bug of wave starting when phase not zero[/b][/color]

thanks to Prof Hwang codes here
Ejs Open Source 1 Dimension Doppler Effect Sound Wave Java Applet