NAME
Geo::Horizon - Calculate distance to the visual horizon
SYNOPSIS
use Geo::Horizon;
my $gh = Geo::Horizon->new("WGS84");
my $lat=39;
my $alt=1.7;
my $distance_to_horizon=$gh->distance($alt,$lat);
print "Input Lat: $lat1\n";
print "Output Distance: $dist\n";
DESCRIPTION
A perl object of calculating the distance to the visual horizon on an ellipsoid.
CONSTRUCTOR
new
my $gh = Geo::Horizon->new(); #default WGS84
METHODS
ellipsoid
Method to set or retrieve the current ellipsoid object. The ellipsoid is a Geo::Ellipsoids object.
my $ellipsoid=$gh->ellipsoid; #Default is WGS84
$gh->ellipsoid('Clarke 1866'); #Built in ellipsoids from Geo::Ellipsoids
$gh->ellipsoid({a=>1}); #Custom Sphere 1 unit radius
distance
The straight-line of sight distance to the horizon:
my $dist=$obj->distance($alt, $lat);
my $dist=$obj->distance($alt); #default lat => 0
Formula from http://newton.ex.ac.uk/research/qsystems/people/sque/physics/horizon/
Ds = sqrt(h(2R + h))
The curved distance along the ellipsoid to the horizon:
my $dist=$obj->distance_great_circle($alt, $lat);
my $dist=$obj->distance_great_circle($alt);
my $dist=$obj->distance_great_circle();
Formula from http://newton.ex.ac.uk/research/qsystems/people/sque/physics/horizon/
Dc = R acos(R / (R + h))
TODO
BUGS
Please send to the geo-perl email list.
LIMITS
AUTHOR
Michael R. Davis qw/perl michaelrdavis com/
LICENSE
Copyright (c) 2006 Michael R. Davis (mrdvt92)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Geo::Ellipsoids