17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

CIRCLE Statement<br />

Purpose:<br />

To draw a circle, ellipse, and angles on the screen during use of the Graphics mode.<br />

Syntax:<br />

CIRCLE(xcenter, ycenter), radius[,[color][,[start],[end][,aspect]]]<br />

Comments:<br />

xcenter and ycenter are the x- and y- coordinates of the center of the ellipse, and radius is<br />

the radius (measured along the major axis) of the ellipse. The quantities xcenter and ycenter<br />

can be expressions. The center attributes can use either absolute or relative coordinates.<br />

color specifies the color of the ellipse. Its value depends on the current screen mode. See the<br />

COLOR and SCREEN statements for more information on using colors in different screen<br />

modes. In the high-resolution mode, 0 indicates black and 1 indicates white. The default for the<br />

high resolution mode is 1.<br />

The start and end angle parameters are radian arguments between -2π and 2π which specify<br />

where the drawing of the ellipse is to begin and end. If start or end is negative, the ellipse is<br />

connected to the center point with a line, and the angles are treated as if they are positive (note<br />

that this is different from adding 2π).<br />

aspect describes the ratio of the x radius to the y radius (x:y). The default aspect ratio depends<br />

on the screen mode, but gives a visual circle in either graphics mode, assuming a standard<br />

monitor screen aspect ratio of 4:3. If the aspect ratio is less than 1, then the radius is given in xpixels.<br />

If it is greater than 1, the radius is given in y-pixels. In many cases, an aspect ratio of 1<br />

gives better ellipses in the medium-resolution mode. This also causes the ellipse to be drawn<br />

faster. The start angle may be less than the end angle.<br />

Example 1:<br />

10 SCREEN1: CIRCLE(100,100), 50<br />

Draws a circle of radius 50, centered at graphics points 100x and 100y.<br />

Example 2:<br />

1 ' This will draw 17 ellipses<br />

10 CLS<br />

20 SCREEN 1<br />

30 FOR R=160 TO 0 STEP-10<br />

40 CIRCLE (160,100),R,,,,5/18<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/CIRCLE.html (1 of 2)28/03/2004 21.29.15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!