Geo::Sun - Calculates the Geodetic Position of the Sun over the Surface of the Earth


Geo-Sun documentation  | view source Contained in the Geo-Sun distribution.

Index


NAME

Top

Geo::Sun - Calculates the Geodetic Position of the Sun over the Surface of the Earth

SYNOPSIS

Top

  use Geo::Sun;
  my $gs=Geo::Sun->new;                              #isa Geo::Sun
  my $point=$gs->set_datetime(DateTime->now)->point; #Full OO interface
  printf "Point isa %s\n", ref($point);              #isa GPS::Point
  printf "Latitude: %s, Longitude: %s\n", $point->latlon;

DESCRIPTION

Top

The Geo::Sun package calculates the position of the Sun over the Earth. The user method point_dt takes a DateTime object as a parameter and returns a GPS::Point which is the point on the earth where the Sun is directly over at the given time.

The Geo::Sun package is a wrapper around Astro::Coord::ECI::Sun with a user friendly interface.

USAGE

Top

  use Geo::Sun;
  my $gs=Geo::Sun->new;
  printf "Lat: %s, Lon: %s\n", $gs->point->latlon;

CONSTRUCTOR

Top

new

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

METHODS

Top

point

Returns a GPS::Point for the location of the sun at the current datetime.

  my $point=$gs->point;
  my $point=$gs->set_datetime(DateTime->now)->point;

point_dt

Set the current datetime and returns a GPS::Point

  my $point=$gs->point_dt($datetime);

Implemented as

  my $point=$gs->set_datetime($datetime)->point;

datetime

Sets or returns the current datetime which is a DateTime object. The default is DateTime->now.

set_datetime

Sets datetime returns self

METHODS (INTERNAL)

Top

point_recalculate

Recalculates the point when the DateTime is changed.

point_onchange

Override this method if you want to calculate something when the point changes

sun

Sets or returns the Astro::Coord::ECI::Sun object.

  my $sun=$gs->sun;

ellipsoid

Set or returns the Geo::Ellipsoids object.

  my $ellipsoid=$gs->ellipsoid;  #WGS84

BUGS

Top

Please send to the geo-perl email list.

SUPPORT

Top

Try the geo-perl email list.

LIMITATIONS

Top

Calculations are only good to about 3 decimal places.

AUTHOR

Top

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

COPYRIGHT

Top

SEE ALSO

Top


Geo-Sun documentation  | view source Contained in the Geo-Sun distribution.