Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CIRCLE Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
CIRCLE [STEP] (x!,y!),radius![,[color%] [,[start!] [,[end!] [,aspect!]]]]
Usage Notes
■ You must be in a graphics screen mode (for example, screen mode 1) to
use the CIRCLE statement; otherwise, Visual Basic may generate the error
message, "Illegal function call." See: ◄SCREEN Statement►
■ The arguments start! and end! can range from -2pi radians to 2pi
radians, where pi ≈ 3.141593. The default value for start! is 0
radians; the default value for end! is 2pi radians.
■ To convert values from degrees to radians, multiply the angle (in
degrees) by pi/180 (approximately equal to 0.0174532925199433).
■ If start! or end! is negative, CIRCLE draws a radius to start! and
treats the angle as positive. If end! is negative, CIRCLE draws a
radius to end! and treats the angle as positive. If both start! and
end! are negative, CIRCLE draws a radius to both start! and end! and
treats the angle as positive.
■ The start angle can be less than the end angle. If you specify end! but
not start!, the arc is drawn from 0 to end; if you specify start! but
not end!, the statement draws an arc from start! to 2pi.
■ The aspect ratio is calculated as:
aspect = 4 * (ypixels/xpixels)/3
where xpixels by ypixels is the screen resolution.
■ If the aspect ratio is less than one, radius! is the x radius. If
aspect! is greater than one, radius! is equal to the y radius.
■ To draw a radius to angle 0 (a horizontal line segment to the right),
do not give the angle as -0; use a small nonzero value instead. For
example:
SCREEN 2 ' Draws a pie-shaped one-
CIRCLE (200,100),60,,-.0001,-1.57 ' quarter wedge of a circle
■ You can omit an argument in the middle of the statement, but you must
include the argument's commas. If you omit a trailing argument, do not
include its corresponding commas. In the following statement, color% has
been omitted:
CIRCLE STEP (150,200),94,,0.0,6.28
■ The CIRCLE statement updates the graphics cursor position to the center
of the ellipse or circle.
■ You can use coordinates that are outside the screen or viewport.
■ You can show coordinates as absolutes, or you can use the STEP keyword
to show the position of the center point in relation to the previous
point of reference. For example, if the previous point of reference
were (10,10), then:
CIRCLE STEP (10,5), 75
would draw a circle with radius 75, and center offset 10 from the
current x coordinate and 5 from the current y coordinate. The circle's
center center would be (20,15).