Veronica's code for Drawing Complicated Circles
SLAVE CODE FOLLOWS
<?php
// create a PNG image file
// create a blank image that is 200 pixels wide and 200 pixels tall
$image = imagecreate(220, 220);
// allocate some colors (all RGB HEX)
$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$yellow = imagecolorallocate($image, 0xFF, 0xFF, 0xAA);
$darkyellow = imagecolorallocate($image, 0xF0, 0xD9, 0x65);
$orange = imagecolorallocate($image, 0xED, 0x90, 0x4E);
$darkorange = imagecolorallocate($image, 0xD9, 0x66, 0x16);
$red = imagecolorallocate($image, 0xED, 0x4E, 0x84);
$darkred = imagecolorallocate($image, 0xD9, 0x16, 0x58);
$blue = imagecolorallocate($image, 0x54, 0x37, 0xEB);
$darkblue = imagecolorallocate($image, 0x30, 0x13, 0xC2);
$green = imagecolorallocate($image, 0x37, 0xEB, 0x90);
$darkgreen = imagecolorallocate($image, 0x13, 0xC2, 0x6A);
// fill the entire image (i.e., background)
imagefilledrectangle($image, 0, 0, 400, 300, $gray);
// create the 3D effect (stack oval arcs to create a pie chart)
// fill-arcs (image, x, y, arc-width, arc-height, start-angle, end-angle, color)
for ($i = 120; $i > 100; $i--)
{
imagefilledarc($image, 110, $i, 200, 100, 0, 45, $darkred, IMG_ARC_PIE);
imagefilledarc($image, 110, $i, 200, 100, 45, 75 , $darkyellow, IMG_ARC_PIE);
imagefilledarc($image, 110, $i, 200, 100, 75, 95 , $darkgreen, IMG_ARC_PIE);
imagefilledarc($image, 110, $i, 200, 100, 95, 140 , $darkorange, IMG_ARC_PIE);
imagefilledarc($image, 110, $i, 200, 100, 140, 360 , $darkblue, IMG_ARC_PIE);
}
// draw last oval-arc to cap the pie chart
imagefilledarc($image, 110, 100, 200, 100, 0, 45, $red, IMG_ARC_PIE);
imagefilledarc($image, 110, 100, 200, 100, 45, 75 , $yellow, IMG_ARC_PIE);
imagefilledarc($image, 110, 100, 200, 100, 75, 95, $green, IMG_ARC_PIE);
imagefilledarc($image, 110, 100, 200, 100, 95, 140 , $orange, IMG_ARC_PIE);
imagefilledarc($image, 110, 100, 200, 100, 140, 360 , $blue, IMG_ARC_PIE);
//=== display the image
// tell the server that a PNG image follows
header("Content-type: image/png");
// display the image
imagepng($image);
// destroy the image (i.e., release memory)
imagedestroy ($image);
?>