Name

draw_circle -- Paint a circle to a page

Synopsis

int draw_circle ( float cenx, float ceny, float radius, int page [,array parameters] )

Description

This function paints a circle to the page specified by page.

Actually, it paints a pair of cubic bezier curves that approximate a circle, the PDF format does not support a true "circle" object

The parameters array provides control over the painting operation. Default values are used if not specified.

Examples

Paints a circle with default parameters:

$pdf->draw_circle(100, 100, 50, $page);

Place a red, thick-lined circle:

$param["width"] = 3; // PDF units
$param["strokecolor"] = $pdf->get_color('red');
$pdf->draw_rectangle(100, 100, 50, $page, $param);

See Also

History

The command was added in version 2 of the library.

Bugs

The object created is not a true circle, although it seems to be very close. If any math wiz out there knows how to draw an accurate circle using the cubic bezier curves available to PDF files, I'd be joyful for the equation. See the _make_circle() function in the source code for the current approximation.