#!/usr/bin/perl -w use POSIX 'round'; $PI = 3.14159265358979; # bdeg means "binary degrees", 1/256 of a circle. sub bdsin { return sin($_[0] / 128 * $PI); } sub bdcos { return cos($_[0] / 128 * $PI); } $centerx = 85; $centery = 85; for $r (15, 30, 45, 75) { push @xmin, $centerx - ($r + 10); push @xmax, $centerx + ($r + 10); push @ymin, $centery - ($r + 10); push @ymax, $centery + ($r + 10); for $angle (0..255) { my $x = round($centerx + $r * bdcos($angle)); my $y = round($centery + $r * bdsin($angle)); push @xpoints, $x; push @ypoints, $y; } } print <= 170; print " .byte $_\n"; } print "ymin:\n"; for(@ymin) { print " .byte $_\n"; } print "ymax:\n"; for(@ymax) { $_ = 169 if $_ >= 170; print " .byte $_\n"; } print "points_x:\n"; for(@xpoints) { print " .byte $_\n"; } print "points_y:\n"; for(@ypoints) { print " .byte $_\n"; }