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 MKSA system (meters, kilograms, seconds, amperes) and the CGSM system (centimeters, grams, seconds, gauss), which is commonly used in Astronomy.
The definitions of constants in the MKSA system are available in the file 'gsl_const_mksa.h'. The constants in the CGSM system are defined in 'gsl_const_cgsm.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_MKSA_SPEED_OF_LIGHT
GSL_CONST_MKSA_VACUUM_PERMEABILITY
GSL_CONST_MKSA_VACUUM_PERMITTIVITY
GSL_CONST_MKSA_PLANCKS_CONSTANT_H
GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR
GSL_CONST_NUM_AVOGADRO
GSL_CONST_MKSA_FARADAY
GSL_CONST_MKSA_BOLTZMANN
GSL_CONST_MKSA_MOLAR_GAS
GSL_CONST_MKSA_STANDARD_GAS_VOLUME
GSL_CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT
GSL_CONST_MKSA_GAUSS
GSL_CONST_MKSA_MICRON
GSL_CONST_MKSA_HECTARE
GSL_CONST_MKSA_MILES_PER_HOUR
GSL_CONST_MKSA_KILOMETERS_PER_HOUR
GSL_CONST_MKSA_ASTRONOMICAL_UNIT
GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT
GSL_CONST_MKSA_LIGHT_YEAR
GSL_CONST_MKSA_PARSEC
GSL_CONST_MKSA_GRAV_ACCEL
GSL_CONST_MKSA_SOLAR_MASS
GSL_CONST_MKSA_ELECTRON_CHARGE
GSL_CONST_MKSA_ELECTRON_VOLT
GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS
GSL_CONST_MKSA_MASS_ELECTRON
GSL_CONST_MKSA_MASS_MUON
GSL_CONST_MKSA_MASS_PROTON
GSL_CONST_MKSA_MASS_NEUTRON
GSL_CONST_NUM_FINE_STRUCTURE
GSL_CONST_MKSA_RYDBERG
GSL_CONST_MKSA_BOHR_RADIUS
GSL_CONST_MKSA_ANGSTROM
GSL_CONST_MKSA_BARN
GSL_CONST_MKSA_BOHR_MAGNETON
GSL_CONST_MKSA_NUCLEAR_MAGNETON
GSL_CONST_MKSA_ELECTRON_MAGNETIC_MOMENT
GSL_CONST_MKSA_PROTON_MAGNETIC_MOMENT
GSL_CONST_MKSA_THOMSON_CROSS_SECTION
GSL_CONST_MKSA_MINUTE
GSL_CONST_MKSA_HOUR
GSL_CONST_MKSA_DAY
GSL_CONST_MKSA_WEEK
GSL_CONST_MKSA_INCH
GSL_CONST_MKSA_FOOT
GSL_CONST_MKSA_YARD
GSL_CONST_MKSA_MILE
GSL_CONST_MKSA_MIL
GSL_CONST_MKSA_NAUTICAL_MILE
GSL_CONST_MKSA_FATHOM
GSL_CONST_MKSA_KNOT
GSL_CONST_MKSA_POINT
GSL_CONST_MKSA_TEXPOINT
GSL_CONST_MKSA_ACRE
GSL_CONST_MKSA_LITER
GSL_CONST_MKSA_US_GALLON
GSL_CONST_MKSA_CANADIAN_GALLON
GSL_CONST_MKSA_UK_GALLON
GSL_CONST_MKSA_QUART
GSL_CONST_MKSA_PINT
GSL_CONST_MKSA_POUND_MASS
GSL_CONST_MKSA_OUNCE_MASS
GSL_CONST_MKSA_TON
GSL_CONST_MKSA_METRIC_TON
GSL_CONST_MKSA_UK_TON
GSL_CONST_MKSA_TROY_OUNCE
GSL_CONST_MKSA_CARAT
GSL_CONST_MKSA_GRAM_FORCE
GSL_CONST_MKSA_POUND_FORCE
GSL_CONST_MKSA_KILOPOUND_FORCE
GSL_CONST_MKSA_POUNDAL
GSL_CONST_MKSA_CALORIE
GSL_CONST_MKSA_BTU
GSL_CONST_MKSA_THERM
GSL_CONST_MKSA_HORSEPOWER
GSL_CONST_MKSA_BAR
GSL_CONST_MKSA_STD_ATMOSPHERE
GSL_CONST_MKSA_TORR
GSL_CONST_MKSA_METER_OF_MERCURY
GSL_CONST_MKSA_INCH_OF_MERCURY
GSL_CONST_MKSA_INCH_OF_WATER
GSL_CONST_MKSA_PSI
GSL_CONST_MKSA_POISE
GSL_CONST_MKSA_STOKES
GSL_CONST_MKSA_STILB
GSL_CONST_MKSA_LUMEN
GSL_CONST_MKSA_LUX
GSL_CONST_MKSA_PHOT
GSL_CONST_MKSA_FOOTCANDLE
GSL_CONST_MKSA_LAMBERT
GSL_CONST_MKSA_FOOTLAMBERT
GSL_CONST_MKSA_CURIE
GSL_CONST_MKSA_ROENTGEN
GSL_CONST_MKSA_RAD
GSL_CONST_MKSA_NEWTON
GSL_CONST_MKSA_DYNE
GSL_CONST_MKSA_JOULE
GSL_CONST_MKSA_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 MKSA 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_mksa.h> int main (void) { double c = GSL_CONST_MKSA_SPEED_OF_LIGHT; double au = GSL_CONST_MKSA_ASTRONOMICAL_UNIT; double minutes = GSL_CONST_MKSA_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.