home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1996 March / buyer-0396.iso / thompson / vincent / product / sinus.pas < prev    next >
Pascal/Delphi Source File  |  1995-09-11  |  667b  |  34 lines

  1.  
  2. program sinus;
  3.  
  4. const
  5.      nom_fichier='Sinus.txt';
  6.      fin='FIN.';
  7.      polygone='POLYGONE';
  8.      finpoly='FIN_POLY';
  9.  
  10. var i:real;
  11.     x,y:integer;
  12.     script:text;
  13.  
  14.  
  15. begin
  16.      Assign(script, nom_fichier);
  17.      {$I-}  Rewrite(script);  {$I+}
  18.      if IOResult=0 then
  19.      begin
  20.           writeln(script,polygone);
  21.           i:=0.0;
  22.           repeat
  23.                 x:=20+round(i*20);
  24.                 y:=100-round(sin(i)*40);
  25.                 writeln(script,'    ',x:4,',',y:4);
  26.                 i:=i+0.1;
  27.           until i>=4*pi;
  28.           writeln(script,finpoly);
  29.           writeln(script,fin);
  30.      end;
  31.      close(script);
  32. end.
  33.  
  34.