`prev Menu next`

DRAW CIRCLE, DRAW DISK (original enhancement)

DRAW circle
draws a circle of radius 1 and of center the origin with the line color.
The beam shall be set off.

DRAW disk
draws a circle and fill the interior of it with the area color.
The beam shall remain.

These can be transformed. For example,
if you want to draw a circle of radius r, center (x,y), write
`DRAW circle WITH SCALE(r)*SHIFT(x,y)`
Refer to picture definition

<Note>
CIRCLE and DISK are not reserved words.
Thus a user can define a picture of its name "CIRCLE" or "DISK".

<Note>
If the circle crosses a line at infinity as a result of transformation, The DRAW statements above do not draw proper figures.
On such a case, the following picture definition is effective.

    1000 EXTERNAL PICTURE circle
    1010 OPTION ANGLE DEGREES
    1020 FOR t=0 TO 360
    1030    PLOT LINES : COS(t),SIN(t);
    1040 NEXT t
    1050 END PICTURE
    2000 EXTERNAL PICTURE disk
    2010 OPTION ANGLE DEGREES
    2020 OPTION BASE 0
    2030 DIM x(359),y(359)
    2040 FOR t=0 TO 359
    2050    LET x(t)=COS(t)
    2060    LET y(t)=SIN(t)
    2070 NEXT t
    2080 MAT PLOT AREA : x,y
    2090 END PICTURE