[Loadstone] Crossing the international date line
karahasan at onlinehome.de
Thu Aug 23 21:31:01 BST 2007
Sorry to come up again with this. We have discussed it a fiew months ago.
Shawn said that the date line currently cannot be crossed, because ls thinks
that you are on the other side of the earth.
When I do distance calculations in a little perl script, it works fine even
accross the date line boundary. So what is loadstone's exact problem? Or is
it me doing something wrong?
# calculates the distances between two geographical points on earth
# coordinates must be given at the command line as lat1 lon1 lat2 lon2
my $r = 6378.137; # equator radius
# we must first translate all degree values into rad values for the
my $lat1 = deg2rad($ARGV);
my $lon1 = deg2rad($ARGV);
my $lat2 = deg2rad($ARGV);
my $lon2 = deg2rad($ARGV);
# distance formular
$distance = acos(sin($lat1)*sin($lat2) +
cos($lat1)*cos($lat2)*cos($lon2-$lon1)) * $r;
print $distanz . "\n";
More information about the Loadstone