home *** CD-ROM | disk | FTP | other *** search
-
- moving radar:
- enter graphics mode;
- print heading;
- determine parameters;
- draw moving radar;
- wait for confirmation (2 * graphics x limit DIV 3, 1);
- leave graphics mode.
-
- print heading:
- put ("Moving radar");
- line;
- put ("============");
- line.
-
- determine parameters:
- REAL VAR radius :: ask real ("Radius? ");
- radius := min (radius, real (min (graphics y limit, graphics x limit)) / 2.1);
- put ("Radius used: ");
- put (text (int (radius), 3));
- REAL CONST step x :: min (1.0, real (graphics x limit) / 360.0);
- REAL VAR centre x :: max (0.0, radius - 260.0);
- INT CONST centre y :: graphics y limit - int (radius).
-
- draw moving radar:
- INT VAR i;
- FOR i FROM 0 UPTO 360
- REP
- move (round (centre x), centre y);
- draw (round (centre x + aspect * sin (i) * radius), centre y + round (cos (i) * radius));
- centre x INCR step x
- ENDREP.
-
-
-