Programming and Graphics

(Kiana) #1

7.6 Graph animation 235


Figure 7.6.1 Snapshot of a traveling wave produced by theVogleanimation code
graph2danm.cc.

if(Iplot==3) vnewdev("cps");
if(Iplot==4) vnewdev("cps");
if(Iplot==5) vnewdev("pcps");
if(Iplot==6) vnewdev("pcps");

Itry = 1;
goto repeat;
}

t = t+Dt;

goto repeat;

//--- Done

return 0;
}

A snapshot of the animation is shown in Figure 7.6.1.


When the cursor is on the graphics window and the “q” key is pressed,
the application quits. When the “s” key is pressed, the application stops and
asks whether a postscript file should be printed.

Free download pdf