Syntax:
circle
[
fill
] x, y, radius [to|plot startAngle, angleSize]
Description:
Draws a circle, an arc or a wedge in the current foreground color, pen pattern and pen size. If a circle or wedge is drawn using the fill
keyword, the circle or wedge will be filled with the current pen pattern.
If only the x
, y
, and radius
parameters are specified, then a complete circle is drawn, with its center at point (x, y
) and having a radius of radius
pixels.
If the to
keyword is specified, then a wedge (two radii plus an arc) is drawn. The first radius is drawn in the orientation specified by startAngle
, which is measured in units of "brads" (see below). Angles are measured counterclockwise starting from the "3-o'clock" position, which corresponds to zero brads. The angleSize
parameter specifies the angular width of the wedge (also in brads); the wedge always extends counterclockwise from the startAngle
position. Note that the width of the "wedge" may be greater than a half-circle, in which case the "wedge" looks more like a Pac-Man.
If the plot
keyword is specified, then an arc is drawn without any radii. The position and size of the arc are the same as when the to
keyword is specified. If both the plot
keyword and the fill
keyword are specified, then the circle
command does nothing.
"Brads" are an angular unit in which a full circle corresponds to 256 brads. A brad is therefore slightly larger than a degree (to be exact, it's 360/256 of a degree). A half circle therefore equals 128 brads, and a right angle equals 64 brads.
Note:
If you use values outside the range 0..255 for startAngle
and/or angleSize
, then values modulo 256 will be used.
See Also:
fill