home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / elan / intgraph / radar.eln < prev    next >
Text File  |  1988-10-11  |  646b  |  31 lines

  1.  
  2. radar:
  3.   enter graphics mode;
  4.   print heading;
  5.   determine parameters;
  6.   draw radar;
  7.   wait for confirmation (2 * graphics x limit DIV 3, 1);
  8.   leave graphics mode.
  9.  
  10. print heading:
  11.   put ("Radar");
  12.   line;
  13.   put ("=====").
  14.  
  15. determine parameters:
  16.   REAL CONST radius ::
  17.     real (min (graphics x limit, graphics y limit)) / 2.1;
  18.   INT CONST centre x :: graphics x limit DIV 2,
  19.             centre y :: graphics y limit DIV 2.
  20.  
  21. draw radar:
  22.   INT VAR i;
  23.   FOR i FROM 0 UPTO 359
  24.   REP
  25.     move (centre x, centre y);
  26.     draw (centre x + round (aspect * sin (i) * radius),
  27.           centre y + round (cos (i) * radius))
  28.   ENDREP.
  29.  
  30. 
  31.