Go to the first, previous, next, last section, table of contents.
This chapter describes macros for the values of physical constants, such as the speed of light, c, and gravitational constant, G. The values are available in different unit systems, including the standard MKS system (meters, kilograms, seconds) and the CGS system (centimeters, grams, seconds), which is commonly used in Astronomy.
The definitions of constants in the MKS system are available in the file `gsl_const_mks.h'. The constants in the CGS system are defined in `gsl_const_cgs.h'. Dimensionless constants, such as the fine structure constant, which are pure numbers are defined in `gsl_const_num.h'.
The full list of constants is described briefly below. Consult the header files themselves for the values of the constants used in the library.
GSL_CONST_MKS_SPEED_OF_LIGHT
GSL_CONST_MKS_VACUUM_PERMEABILITY
GSL_CONST_MKS_VACUUM_PERMITTIVITY
GSL_CONST_NUM_AVOGADRO
GSL_CONST_MKS_FARADAY
GSL_CONST_MKS_BOLTZMANN
GSL_CONST_MKS_MOLAR_GAS
GSL_CONST_MKS_STANDARD_GAS_VOLUME
GSL_CONST_MKS_GAUSS
GSL_CONST_MKS_MICRON
GSL_CONST_MKS_HECTARE
GSL_CONST_MKS_MILES_PER_HOUR
GSL_CONST_MKS_KILOMETERS_PER_HOUR
GSL_CONST_MKS_ASTRONOMICAL_UNIT
GSL_CONST_MKS_GRAVITATIONAL_CONSTANT
GSL_CONST_MKS_LIGHT_YEAR
GSL_CONST_MKS_PARSEC
GSL_CONST_MKS_GRAV_ACCEL
GSL_CONST_MKS_SOLAR_MASS
GSL_CONST_MKS_ELECTRON_CHARGE
GSL_CONST_MKS_ELECTRON_VOLT
GSL_CONST_MKS_UNIFIED_ATOMIC_MASS
GSL_CONST_MKS_MASS_ELECTRON
GSL_CONST_MKS_MASS_MUON
GSL_CONST_MKS_MASS_PROTON
GSL_CONST_MKS_MASS_NEUTRON
GSL_CONST_NUM_FINE_STRUCTURE
GSL_CONST_MKS_RYDBERG
GSL_CONST_MKS_BOHR_RADIUS
GSL_CONST_MKS_ANGSTROM
GSL_CONST_MKS_BARN
GSL_CONST_MKS_BOHR_MAGNETON
GSL_CONST_MKS_NUCLEAR_MAGNETON
GSL_CONST_MKS_ELECTRON_MAGNETIC_MOMENT
GSL_CONST_MKS_PROTON_MAGNETIC_MOMENT
GSL_CONST_MKS_MINUTE
GSL_CONST_MKS_HOUR
GSL_CONST_MKS_DAY
GSL_CONST_MKS_WEEK
GSL_CONST_MKS_INCH
GSL_CONST_MKS_FOOT
GSL_CONST_MKS_YARD
GSL_CONST_MKS_MILE
GSL_CONST_MKS_MIL
GSL_CONST_MKS_NAUTICAL_MILE
GSL_CONST_MKS_FATHOM
GSL_CONST_MKS_KNOT
GSL_CONST_MKS_POINT
GSL_CONST_MKS_TEXPOINT
GSL_CONST_MKS_ACRE
GSL_CONST_MKS_LITER
GSL_CONST_MKS_US_GALLON
GSL_CONST_MKS_CANADIAN_GALLON
GSL_CONST_MKS_UK_GALLON
GSL_CONST_MKS_QUART
GSL_CONST_MKS_PINT
GSL_CONST_MKS_POUND_MASS
GSL_CONST_MKS_OUNCE_MASS
GSL_CONST_MKS_TON
GSL_CONST_MKS_METRIC_TON
GSL_CONST_MKS_UK_TON
GSL_CONST_MKS_TROY_OUNCE
GSL_CONST_MKS_CARAT
GSL_CONST_MKS_GRAM_FORCE
GSL_CONST_MKS_POUND_FORCE
GSL_CONST_MKS_KILOPOUND_FORCE
GSL_CONST_MKS_POUNDAL
GSL_CONST_MKS_CALORIE
GSL_CONST_MKS_BTU
GSL_CONST_MKS_THERM
GSL_CONST_MKS_HORSEPOWER
GSL_CONST_MKS_BAR
GSL_CONST_MKS_STD_ATMOSPHERE
GSL_CONST_MKS_TORR
GSL_CONST_MKS_METER_OF_MERCURY
GSL_CONST_MKS_INCH_OF_MERCURY
GSL_CONST_MKS_INCH_OF_WATER
GSL_CONST_MKS_PSI
GSL_CONST_MKS_POISE
GSL_CONST_MKS_STOKES
GSL_CONST_MKS_STILB
GSL_CONST_MKS_LUMEN
GSL_CONST_MKS_LUX
GSL_CONST_MKS_PHOT
GSL_CONST_MKS_FOOTCANDLE
GSL_CONST_MKS_LAMBERT
GSL_CONST_MKS_FOOTLAMBERT
GSL_CONST_MKS_CURIE
GSL_CONST_MKS_ROENTGEN
GSL_CONST_MKS_RAD
GSL_CONST_MKS_NEWTON
GSL_CONST_MKS_DYNE
GSL_CONST_MKS_JOULE
GSL_CONST_MKS_ERG
These constants are dimensionless scaling factors.
GSL_CONST_NUM_YOTTA
GSL_CONST_NUM_ZETTA
GSL_CONST_NUM_EXA
GSL_CONST_NUM_PETA
GSL_CONST_NUM_TERA
GSL_CONST_NUM_GIGA
GSL_CONST_NUM_MEGA
GSL_CONST_NUM_KILO
GSL_CONST_NUM_MILLI
GSL_CONST_NUM_MICRO
GSL_CONST_NUM_NANO
GSL_CONST_NUM_PICO
GSL_CONST_NUM_FEMTO
GSL_CONST_NUM_ATTO
GSL_CONST_NUM_ZEPTO
GSL_CONST_NUM_YOCTO
The following program demonstrates the use of the physical constants in a calculation. In this case, the goal is to calculate the range of light-travel times from Earth to Mars.
The required data is the average distance of each planet from the Sun in astronomical units (the eccentricities of the orbits will be neglected for the purposes of this calculation). The average radius of the orbit of Mars is 1.52 astronomical units, and for the orbit of Earth it is 1 astronomical unit (by definition). These values are combined with the MKS values of the constants for the speed of light and the length of an astronomical unit to produce a result for the shortest and longest light-travel times in seconds. The figures are converted into minutes before being displayed.
#include <stdio.h> #include <gsl/gsl_const_mks.h> int main (void) { double c = GSL_CONST_MKS_SPEED_OF_LIGHT; double au = GSL_CONST_MKS_ASTRONOMICAL_UNIT; double minutes = GSL_CONST_MKS_MINUTE; /* distance stored in meters */ double r_earth = 1.00 * au; double r_mars = 1.52 * au; double t_min, t_max; t_min = (r_mars - r_earth) / c; t_max = (r_mars + r_earth) / c; printf("light travel time from Earth to Mars:\n"); printf("minimum = %.1f minutes\n", t_min / minutes); printf("maximum = %.1f minutes\n", t_max / minutes); return 0; }
Here is the output from the program,
light travel time from Earth to Mars: minimum = 4.3 minutes maximum = 21.0 minutes
Further information on the values of physical constants is available from the NIST website,
Go to the first, previous, next, last section, table of contents.