- my @ans = Prefix::extract($l);
- print "ans:", @ans, "\n";
- next if !@ans;
- my $pre = shift @ans;
- my $a;
- foreach $a (@ans) {
- push @out, sprintf "%s DXCC: %3d ITU: %3d CQ: %3d (%s, %s)", uc $l, $a->dxcc(), $a->itu(), $a->cq(), $pre, $a->name();
- }
+ # prefixes --->
+ my @ans = Prefix::extract($l);
+ next if !@ans;
+ my $pre = shift @ans;
+ my $a;
+ foreach $a (@ans) {
+ my ($b, $dx) = DXBearing::bdist($lat, $long, $a->{lat}, $a->{long});
+ my ($r, $rdx) = DXBearing::bdist($a->{lat}, $a->{long}, $lat, $long);
+ push @out, sprintf "%-2s %s: %.0f degs - dist: %.0f mi, %.0f km Reciprocal heading: %.0f degs", $pre, $a->name(), $b, $dx * 0.62133785, $dx, $r;
+ $l = "";
+ }