And for the peculiar, here's how I do ring/ray distance calculations.
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> sub _distance
{
my ($row1, $col1, $row2, $col2) = @_;
my $a1 = ($row1 + int($col1/2));
my $a2 = ($row2 + int($col2/2));
my $d1 = abs( $a1 - $a2 );
my $d2 = abs( $col1 - $col2 );
my $d3 = abs( ($a1 - $col1) - ( $a2 - $col2 ) );
#return (reverse sort { $a <=> $b } ( $d1, $d2, $d3 ))[0];
return (sort { $a <=> $b } ($d1, $d2, $d3))[2];
}</pre>[/QUOTE]And here's where I store the ring/ray offsets for commonly used sectors.
</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> sub getGalacticCoords
{
my $self = shift;
my $uwp = shift;
my $sector = shift;
my %ringray =
(
'gvurrdon' => [ 9880 , 62704 ],
'tuglikki' => [ 9880 , 62736 ],
'spinward marches'=> [ 9920 , 62704 ],
'deneb' => [ 9920 , 62736 ],
'corridor' => [ 9920 , 62768 ],
'vland' => [ 9920 , 62800 ],
'lishun' => [ 9920 , 62832 ],
'antares' => [ 9920 , 62864 ],
'empty quarter' => [ 9920 , 62896 ],
'trojan reaches' => [ 9960 , 62704 ],
'reft' => [ 9960 , 62736 ],
'gushemege' => [ 9960 , 62768 ],
'dagudashaag' => [ 9960 , 62800 ],
'dagudashag' => [ 9960 , 62800 ],
'core' => [ 9960 , 62832 ],
'fornast' => [ 9960 , 62864 ],
'riftspan' => [ 10000 , 62704 ],
'verge' => [ 10000 , 62736 ],
'ilelish' => [ 10000 , 62768 ],
'zarushagar' => [ 10000 , 62800 ],
'massilia' => [ 10000 , 62832 ],
'delphi' => [ 10000 , 62864 ],
'reaver\'s deep' => [ 10040 , 62768 ],
'daibei' => [ 10040 , 62800 ],
'diaspora' => [ 10040 , 62832 ],
'old expanses' => [ 10040 , 62864 ],
'dark nebula' => [ 10080 , 62768 ],
'magyar' => [ 10080 , 62800 ],
'solomani rim' => [ 10080 , 62832 ],
'alpha crucis' => [ 10080 , 62864 ],
);
my ($ringoff, $rayoff) = @{$ringray{ lc $sector }};
my ($ring, $ray) = ($ringoff, $rayoff );
($ring, $ray) = ($ringoff + $uwp->row,
$rayoff + $uwp->col) if $uwp;
$ray -= 62832 if $ray > 62832;
return ($ring, $ray);
}</pre>[/QUOTE]