Veronica's code for Drawing Complicated Circles

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(220220);

// allocate some colors (all RGB HEX)
$gray       imagecolorallocate($image0xC00xC00xC0);
$yellow     imagecolorallocate($image0xFF0xFF0xAA);
$darkyellow imagecolorallocate($image0xF00xD90x65);
$orange      imagecolorallocate($image0xED0x900x4E);
$darkorange   imagecolorallocate($image0xD90x660x16);
$red       imagecolorallocate($image0xED0x4E0x84);
$darkred   imagecolorallocate($image0xD90x160x58);
$blue        imagecolorallocate($image0x540x370xEB);
$darkblue    imagecolorallocate($image0x300x130xC2);
$green      imagecolorallocate($image0x370xEB0x90);
$darkgreen  imagecolorallocate($image0x130xC20x6A);

//  fill the entire image (i.e., background)
imagefilledrectangle($image00400300$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($image110$i200100045$darkredIMG_ARC_PIE);
    
imagefilledarc($image110$i2001004575 $darkyellowIMG_ARC_PIE);
    
imagefilledarc($image110$i2001007595 $darkgreenIMG_ARC_PIE);
    
imagefilledarc($image110$i20010095140 $darkorangeIMG_ARC_PIE);
    
imagefilledarc($image110$i200100140360 $darkblueIMG_ARC_PIE);
}

// draw last oval-arc to cap the pie chart
imagefilledarc($image110100200100045$redIMG_ARC_PIE);
imagefilledarc($image1101002001004575 $yellowIMG_ARC_PIE);
imagefilledarc($image1101002001007595$greenIMG_ARC_PIE);
imagefilledarc($image11010020010095140 $orangeIMG_ARC_PIE);
imagefilledarc($image110100200100140360 $blueIMG_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);

?>
 

CODE FOLLOWS

<!--CODE FOLLOWS-->

<?php
include('includes/header.php');

// code
// set error reporting to all
error_reporting(E_ALL);

?>

<h1>Veronica's code for Drawing Complicated Circles</h1>

<img src="complicated_circles.php" alt="complicated circles"> <!-- this is it -->

<?php

// list code for slave routine
echo('<hr><br>SLAVE CODE FOLLOWS<br><br>');
highlight_file ('complicated_circles.php');

include(
'includes/footer.php');
?>