#

package PDL::Astro::Constants;

=head1 NAME

PDL::Astro::Constants - useful constants.

=head1 DESCRIPTION

Defines some useful constants used in Astronomy and Astrophysics.

=head1 SYNOPSIS

  use PDL::Astro::Constants  qw( PARSEC );

  printf "100 pc = %12.6e metres\n", 100 * PARSEC;
  
  ... and a little bit more ...

=head1 NOTES

I did see a more complete set of constants - in a perl module - 
somewhere on the net, but can't find it at the moment. This module
should be removed...      

The module should document where the numbers were taken from.

=cut

use strict;
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
 
use Exporter;

$VERSION = "0.2";

@ISA        = qw ( Exporter );
@EXPORT     = qw ( );
@EXPORT_OK  = qw ( LIGHT PARSEC STERADIAN 
		   DAY YEAR_TROPICAL YEAR_SIDEREAL
		   G 
		   PI FOURPI );

## Variables

=head1 CONSTANTS

=over 4

=item *

LIGHT - the speed of light in m/s.

=item *

PARSEC - one parsec in metres.

=item *

STERADIAN - one steradian in degrees^2.

=item *

DAY - one day in seconds.

=item *

YEAR_TROPICAL - one tropical year in seconds.

=item *

YEAR_SIDEREAL - one sidereal year in seconds.

=item *

G - gravitational constant (m^3/kg/s^2).

=item *

PI - defined as 4.0 * atan(1.0,1.0) for the moment.

=item *

FOURPI - 4.0 * PI

=back

=cut

use constant LIGHT     => 299792458;       # speed of light in m/s
use constant PARSEC    => 3.085678e16;     # 1 parsec in m
use constant STERADIAN => 3282.80635;      # 1 steradian in deg^2

use constant DAY           => 86400;       # 1 day, in seconds
use constant YEAR_TROPICAL => 3.1556926e7; # 1 year (tropical) in seconds
use constant YEAR_SIDEREAL => 3.1558150e7; # 1 year (sidereal) in seconds

use constant G => 6.6726e-11; # gravitational constant in m^3/kg/s^2 (+- 0.0009e-11)

use constant PI     => 4.0 * atan2(1.0,1.0);   # should perhaps fix the value, rather than calculate it
use constant FOURPI => 16.0 * atan2(1.0,1.0);   # should perhaps fix the value, rather than calculate it

## Subroutine definitions

=head1 AUTHOR

Copyright (C) Douglas Burke <dburke@cfa.harvard.edu> 
1999, 2000, 2001.

All rights reserved. There is no warranty. 
This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.

=cut

##### End with a true
1;
