Version: 1.0

Type: Full Script

Category: Graphics

License: GNU General Public License

Description: Uses y=x^3 function to create a symetrical leafy structure



<?
  //*******Author : Frat Tiryaki        **********//
  //*******         firat@pleksus.net.tr **********//
  $width=200;
  $height=200;

  Header("Content-type: image/gif");
  $im = imagecreate($width,$height);
  $white=ImageColorAllocate($im,255,255,255);
  $blue=ImageColorAllocate($im,1,18,250);
  $red=ImageColorAllocate($im,125,12,89);
  $centerx=100;
  $centery=100;

  for ($x=-100;$x<=100;$x++)
   {
    for ($sub=500;$sub<=10000;$sub+=500)
       {
       $new=($x*$x*$x)/$sub;
       imagesetpixel ($im, ($centerx+$x), ($centery-$new), $blue);
       imagesetpixel ($im, ($centery-$new),($centerx+$x) , $red);
       imagesetpixel ($im, ($centerx-$x), ($centery-$new), $red);
       imagesetpixel ($im, ($centery+$new),($centerx+$x) , $blue);
       }
   }
  imagePng($im);
  ImageDestroy($im);
?>