
Geo::Sun::Bearing - Calculates the bearing from a station on the surface of the Earth to the Sun.

use Geo::Sun::Bearing; use GPS::Point; my $datetime=DateTime->now; my $station=GPS::Point->new(lat=>39, lon=>-77); my $gs=Geo::Sun::Bearing->new->set_datetime($datetime)->set_station($station); printf "Bearing from Station to Sun is %s\n", $gs->bearing;

The Geo::Sun::Bearing is a Geo::Sun object. This package calculates the bearing from a station on the surface of the Earth to the point where the Sun is directly over at the given time.

use Geo::Sun::Bearing; my $gs=Geo::Sun::Bearing->new;

my $gs=Geo::Sun::Bearing->new; #Inherited from Geo::Sun my $gs=Geo::Sun::Bearing->new(datetime=>$dt, station=>$station);

Many methods are inherited from Geo::Sun.
Returns the bearing from the station to the Sun.
Returns bearing given a datetime and a station point.
my $bearing=$gs->bearing_dt_pt($datetime, $station);
Implemented as
my $bearing=$gs->set_datetime($datetime)->set_station($station)->bearing;
Sets or returns station. Station must be a valid point argument for GSP::Point distance method. Currently, Geo::Point and GPS::Point. I'm planning to add {lat=>$lat, lon=>$lon} and [$lat, $lon] shortly.
Sets station returns self

Overridden from Geo::Sun to recalculate the bearing when the point changes
Method which is called to recalculate the bearing when the datetime or the station is changed.
In this base module this does nothing but to return the object
Override this function if you want to calculate something when the bearing changes. By nature this hook also gets called when point_onchange is called so don't override both.

Please send to the geo-perl email list.

Try the geo-perl email list.

Calculations are only good to about 3 decimal places.

Michael R. Davis
CPAN ID: MRDVT
STOP, LLC
domain=>stopllc,tld=>com,account=>mdavis
http://www.stopllc.com/

This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
