#ifndef UNITS_H #define UNITS_H #include "prconst.h" /* first the group of macors that deal with constants, then the group that uses the first group */ /** Convert arcseconds to degrees */ #define ARCSEC2DEG(a) ((a)/3600.) /** Convert milli-arcseconds to degrees */ #define MAS2DEG(m) ((m)/1.e6/3600.) /** Convert degrees to arcseconds */ #define DEG2ARCSEC(d) (3600.*(d)) /** Convert arc-minutes to degrees */ #define ARCMIN2DEG(a) ((a)/60.) /** Convert degrees to radians */ #define DEG2RAD(d) (M_PI*(d)/180.) /** Convert radians to degrees */ #define RAD2DEG(r) (180.*(r)/M_PI) /** Convert wavelength [microns] to spectroscopic wavenumbers * [1/cm=kayser]. */ #define MICRON2WN(m) (1.e4/(m)) /** Convert spectroscopic wavenumber [1/cm=kayser] * into wavelength [microns] */ #define WN2MICRON(w) (1.e4/(w)) /** Convert momentum measured in [1/m] to spectroscopic wavenumber [1/cm=kayser] * The parameter \c k multiplied with a distance [m] would give a phase [radians], * so the difference between momentum and spectroscopic wavenumber used elsewhere * is the factor 2 pi and the factor 100 for conversion of 1/cm to 1/m. */ #define K2KAYSER(k) ((k)/(2.*M_PI*100.)) #define KAYSER2K(k) (2.*M_PI*100.*(k)) /** Convert momentum measured in [1/m] to wavelength [micron] */ #define K2MICRON(k) (2.*M_PI*1.e6/(k)) /** Convert wavelength [micron] to momentum measured in [1/m] */ #define MICRON2K(m) (2.*M_PI*1.e6/(m)) /** Convert spectroscopic wavenumber [1/cm] to frequency [Hz] */ #define WN2HZ(w) (100.*VACUUMC*(w)) /** Convert frequency [Hz] to spectroscopic wavenumber [1/cm] */ #define HZ2WN(h) ((h)/(100.*VACUUMC)) /** convert Kelvin to Celsius */ #define KELVIN2CELS(k) ((k)-273.15) /** convert Celsius to Kelvin */ #define CELS2KELVIN(c) ((c)+273.15) /** convert radians to arcseconds */ #define RAD2ARCSEC(r) (DEG2ARCSEC(RAD2DEG(r))) /** convert arcseconds to radians */ #define ARCSEC2RAD(a) (DEG2RAD(ARCSEC2DEG(a))) /** convert arc-minutes to radians */ #define ARCMIN2RAD(a) (DEG2RAD(ARCMIN2DEG(a))) /** convert diameter to circle surface area */ #define D2AREA(d) (M_PI_4*(d)*(d)) #endif /* UNITS_H */ /* $Log:$ */