PROGRAM wheel IMPLICIT NONE REAL*8 dt, omega, r, t, vcm, x, xmax, y INTEGER IR_ DATA x/0.0D0/ CALL GWopen(IR_, 0) CALL initial(r,omega,vcm,t,dt,xmax) CALL GWsetpen(IR_, -1, -1, -1, -1) DO WHILE(x .LE. xmax) x = -r*cos(omega*t) + vcm*t y = r*sin(omega*t) * note the semicolon after PLOT x,y CALL GWline2(IR_, REAL(x), REAL(y)) ! abbreviation of PLOT POINT: t = t + dt END DO CALL GWquit(IR_) END C SUBROUTINE initial(r,omega,vcm,t,dt,xmax) IMPLICIT NONE REAL*8 r, omega, vcm, t, dt, xmax REAL mx, xmin INTEGER IR_ t = 0 r = 1 ! radius of wheel omega = 1 ! angular frequency of wheel vcm = r*omega ! velocity of center of mass dt = 0.01D0 ! time increment xmin = -1 xmax = 50 mx = 0.01D0*(xmax - xmin) CALL GWindow(IR_, xmin-mx, -4.0, REAL(xmax+mx), 4.0) * draw ground at y = -r (bottom of wheel) CALL GWline(IR_, xmin, REAL(-r), REAL(xmax), REAL(-r)) END