home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / spezial / 02 / t10.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-02-05  |  542 b   |  26 lines

  1. program t10;
  2. const d=0.0625;
  3.       s=32;
  4.       h1=34;
  5.       h2=68;
  6.       c=6.28318;
  7.       lim=32;
  8.  
  9. var x,y:real; i,j,k,n:integer;
  10.     a:array[1..h2] of char;
  11. begin
  12.   writeln('graphic representation of a function');
  13.   writeln('f(x):=exp(-x)*sin(2*pi*x)');
  14.   for j:=1 to h2 do a[j]:=' ';
  15.   for i:=0 to lim do
  16.   begin x:=d*i; y:=exp(-x)*sin(c*x);
  17.         a[h1]:=':'; n:=round(s*y)+h1; a[n]:='*';
  18.         if n<h1 then k:=h1 else k:=n;
  19.         for j:=1 to k do write(a[j]);
  20.         writeln;
  21.         a[n]:=' '
  22.   end
  23. end.
  24.  
  25.  
  26.