Astro::Constants

Astro::Constants is a Perl module that contains physical constants for use in Astronomy.
Download

Astro::Constants Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Boyd Duffee
  • Publisher web site:
  • http://search.cpan.org/~duffee/Astro-Constants-0.09/Constants.pm

Astro::Constants Tags


Astro::Constants Description

Astro::Constants is a Perl module that contains physical constants for use in Astronomy. Astro::Constants is a Perl module that contains physical constants for use in Astronomy.SYNOPSIS use Astro::Constants::CGS qw(:long); print "The Schwarzschild radius of the sun is ", 2 * GRAVITATIONAL * SOLAR_MASS / LIGHT_SPEED ** 2, " centimetresn";or use Astro::Constants::MKS qw(:short); print "The Schwarzschild radius of the sun is ", 2 * $A_G * $A_msun / $A_c ** 2, " metresn";This module provides a large number of physical constants which are useful to Astronomers. The module itself is essentially a wrapper around the astroconst package of Jeremy Balin.It allows you to choose between constants in units of centimetres/grams/seconds with Astro::Constants::CGS and metres/kilograms/seconds with Astro::Constants::MKS. It also allows you to select two different methods of refering to the constants using the import tags :long and :short.The :short tag refers to the constants in the normal perl variable style, such as $A_G for the gravitational constant and $A_c for the speed of light in a vaccuum. The naming convention for the :short constant is A_ prepended to the symbol character.The :long tag refers to the constants with longer descriptive names in ALL_CAPS that have been created with the use constant pragma. As in the example, GRAVITATIONAL is the gravitational constant and LIGHT_SPEED is the speed of light. This is a new addition to the Astroconst package and, at present, we are following a naming convention of OBJECT_PROPERTY and SYMBOL_SUBSCRIPT. Opinions on this matter will be listened to and if we decline to agree, you can always change it yourself, as described in "EXTENDING THE DATA SET".The :long and the :short tags import the same constants. You may choose individual constants and even mix and match (I haven't tested this) by importing them in the use statement.One of the problems with the long constants is that they are not interpolated in double quotish situations because they are really inlined functions. Requirements: · Perl


Astro::Constants Related Software