#!/usr/bin/perl

# The Goatsebuntu logo

# Dedicated to FuxUbuntu

# Written by Phil Carmody ('FatPhil')
# This work, and the output of it, are in the public domain

use GD;

my $dim=1000;
my $r=$dim/2;
my ($cx, $cy)=($r, $r);

$im = new GD::Image($dim,$dim);
$white = $im->colorAllocate(255,255,255);
$red = $im->colorAllocate(255,0,0);      
$blue = $im->colorAllocate(0,0,255);

$im->transparent(gdTransparent);
$im->filledEllipse($cx,$cy, $dim,    $dim,    $red);
$im->filledEllipse($cx,$cy, $dim*.6, $dim*.6, $white);
$im->filledEllipse($cx,$cy, $dim*.45,$dim*.45,$red);

my $d120=3.1415926536*2/3;
my $d60=$d120/2;
my $d10=$d120/12;

for(my $i=-1; $i<=1; ++$i) {
	for(my $d=-3; $d<=3; $d+=2) {
		$im->filledEllipse($cx + 0.68*$r*cos($i*$d120 + $d60 + $d*$d10),
				   $cy + 0.68*$r*sin($i*$d120 + $d60 + $d*$d10),
				   $r*0.27, $r*0.27, $red);
		$im->filledEllipse($cx + 0.68*$r*cos($i*$d120 + $d60 + $d*$d10),
				   $cy + 0.68*$r*sin($i*$d120 + $d60 + $d*$d10),
				   $r*0.18, $r*0.18, $white);
	}	
}

$im->setThickness($dim*.025);
for(my $i=-1; $i<=1; ++$i) {
	$im->line($cx,$cy, $cx+0.7*$r*cos($i*$d120), $cy+0.7*$r*sin($i*$d120), $red);
}

binmode STDOUT;
print $im->png;
