program curve; const PI = 3.1415927; STEP = 400; { Number of divisions of the time interval.} START_T = 0.0; STOP_T = 6.283185; LEFT = -1.10; { value of u at left of window } RIGHT = 6.50; BOTTOM = -1.10; { value of v at bottom of window } TOP = 1.10; type point = array [ 1 .. 2 ] of real; var tcount : integer; t : real; r : point; procedure line_to(p:point); begin writeln('l ',p[1]:8:3,' ',p[2]:8:3); end; procedure move_to(p:point); begin writeln('m ',p[1]:8:3,' ',p[2]:8:3); end; procedure make_window; begin writeln('w ',LEFT:5:2,' ',BOTTOM:5:2,' ',RIGHT:5:2,' ',TOP:5:2); end; procedure width(i:integer); begin writeln('W ',i); end; begin { program } make_window; width(3); for tcount:= 0 to STEP do begin t:= START_T + (tcount/STEP)*(STOP_T - START_T); r[1]:= t; r[2]:= sin(2*t); if tcount=0 then move_to(r) else line_to(r); end; end. { program } { Not useful here, but save for future reference: function cosh(x:real) : real; begin cosh:=(exp(x)+exp(-1*x))/2; end; function sinh(x:real) : real; begin sinh:=(exp(x)-exp(-1*x))/2; end; function midpoint(p,q:point) : point; var r : point; begin r[1]:= (p[1]+q[1])/2; r[2]:= (p[2]+q[2])/2; midpoint := r; end; }