{
my ($self, $line) = @_;
+ # disguise regexes
+ $line =~ s/\{(.*)\}/'{'. unpack('H*', $1) . '}'/eg;
+ dbg("sh/dx disguise any regex: '$line'") if isdbg('sh/dx');
+
+ # now space out brackets and !
$line =~ s/([\(\!\)])/ $1 /g;
my @list = split /[\s]+/, $line; # split the line up
+ # put back the regexes
+ @list = map { my $l = $_; $l =~ s/\{([0-9a-fA-F]+)\}/'{' . pack('H*', $1) . '}'/eg; $l } @list;
+
+ dbg("sh/dx after regex return: " . join(' ', @list)) if isdbg('sh/dx');
+
my @out;
my $f;
my $call = $self->call;
return (rd($az), $dx);
}
+# just the distance - parameters as above
+sub distance
+{
+ my $hn = dr(shift);
+ my $he = dr(shift);
+ my $n = dr(shift);
+ my $e = dr(shift);
+ return (0, 0) if $hn == $n && $he == $e;
+ my $co = cos($he-$e)*cos($hn)*cos($n)+sin($hn)*sin($n);
+ my $ca = $co ? atan(abs(sqrt(1-$co*$co)/$co)) : $pi;
+ $ca = $pi-$ca if $co < 0;
+ my $dx = 6367*$ca;
+}
+
# turn a lat long string into floating point lat and long
sub stoll
{