mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

Constants of general applicability

Topics

 Boost Constants
 Constants provided by the boost library.

Functions

template<typename T>
constexpr T mx::math::pi ()
 Get the value of pi.
template<typename T>
constexpr T mx::math::two_pi ()
 Get the value of 2pi.
template<typename T>
constexpr T mx::math::half_pi ()
 Get the value of pi/2.
template<typename T>
constexpr T mx::math::rad2deg ()
 Get the value of 180/pi.
template<typename T>
constexpr T mx::math::root_two ()
 Get the value of sqrt(2).
template<typename T>
constexpr T mx::math::ln_two ()
 Get the value of ln(2).
template<typename T>
constexpr T mx::math::root_three ()
 Get the value of sqrt(3).
template<typename T>
constexpr T mx::math::half_root_three ()
 Get the value of sqrt(3)/2.
template<typename T>
constexpr T mx::math::third ()
 Get the value of 1/3.
template<typename floatT>
constexpr floatT mx::math::five_thirds ()
 Return 5/3 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::five_sixths ()
 Return 5/6 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::eleven_thirds ()
 Return 11/3 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::eleven_sixths ()
 Return 11/6 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::six_fifths ()
 Return 6/5 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::three_fifths ()
 Return 3/5 in the specified precision.
template<typename floatT>
constexpr floatT mx::math::seventeen_thirds ()
 Return 17/3 in the specified precision.

Function Documentation

◆ eleven_sixths()

template<typename floatT>
floatT mx::math::eleven_sixths ( )
constexpr

Return 11/6 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 487 of file constants.hpp.

◆ eleven_thirds()

template<typename floatT>
floatT mx::math::eleven_thirds ( )
constexpr

Return 11/3 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 476 of file constants.hpp.

Referenced by mx::AO::analysis::aoAtmosphere< _realT >::alpha().

◆ five_sixths()

template<typename floatT>
floatT mx::math::five_sixths ( )
constexpr

Return 5/6 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 465 of file constants.hpp.

◆ five_thirds()

template<typename floatT>
floatT mx::math::five_thirds ( )
constexpr

◆ half_pi()

template<typename T>
T mx::math::half_pi ( )
constexpr

Get the value of pi/2.

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 152 of file constants.hpp.

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::intensityPSD(), mx::AO::sim::pyramidSensor< _realT, _detectorT, _cudaGPU >::perStep(), mx::AO::analysis::speckleAmpPSD(), TEST_CASE(), and mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::validatePsdInputs().

◆ half_root_three()

template<typename T>
T mx::math::half_root_three ( )
constexpr

Get the value of sqrt(3)/2.

Specializations provided for float, double, long double, and quad (if supported).

Note there is no boost equivalent.

Definition at line 379 of file constants.hpp.

Referenced by mx::sigproc::zernikeModeDOCDiffKolmogorov(), and mx::sigproc::zernikeModeDOCKolmogorov().

◆ ln_two()

template<typename T>
T mx::math::ln_two ( )
constexpr

Get the value of ln(2).

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 288 of file constants.hpp.

◆ pi()

template<typename T>
T mx::math::pi ( )
constexpr

Get the value of pi.

Specializations provided for float, double, long double, and quad if supported. Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 62 of file constants.hpp.

Referenced by mx::math::func::airyPattern(), mx::math::func::airyPattern(), mx::math::func::airyPatternEnclosed(), mx::math::func::airyPatternEnclosed(), mx::astro::calcAzEl(), mx::AO::constants::calcConstants(), mx::improc::drawLine(), mx::AO::analysis::aoAtmosphere< _realT >::dX(), mx::AO::analysis::aoAtmosphere< _realT >::dY(), mx::AO::analysis::F_basic(), mx::AO::analysis::F_mod(), mx::sigproc::window::genCosine(), mx::sigproc::window::genCosine(), mx::sigproc::window::genCosine(), mx::math::fit::guessGauss2D_ang(), mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::initGrid(), mx::AO::analysis::jincFuncs(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::loadGMagAOX(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::loadGuyon2005(), mx::sigproc::makeFourierModeFreqs_Circ(), mx::wfp::fraunhoferPropagator< _wavefrontT, _cudaGPU >::makeShiftPhase(), mx::AO::analysis::vonKarmanSpectrum< realT >::operator()(), mx::astro::orbitLambertPhase(), mx::AO::analysis::phiInt_basic(), mx::AO::analysis::phiInt_mod(), radprofIntegral(), mx::astro::cahoyGrid< _units >::setSpectrum(), TEST_CASE(), mx::wfp::tiltWavefront(), mx::sigproc::window::tukey(), mx::sigproc::window::tukey2d(), mx::sigproc::window::tukey2dAnnulus(), mx::sigproc::window::tukey2dSquare(), mx::AO::analysis::aoAtmosphere< _realT >::update_v_wind(), mx::AO::analysis::aoAtmosphere< _realT >::X(), mx::AO::analysis::aoAtmosphere< _realT >::X_Z(), mx::AO::analysis::aoAtmosphere< _realT >::Y(), mx::sigproc::zernikePAstig(), mx::sigproc::zernikePComa(), mx::sigproc::zernikePDefocus(), mx::sigproc::zernikePPiston(), mx::sigproc::zernikePTipTilt(), mx::sigproc::zernikePTrefoil(), mx::sigproc::zernikeQ(), and mx::sigproc::zernikeQNorm().

◆ rad2deg()

template<typename T>
T mx::math::rad2deg ( )
constexpr

Get the value of 180/pi.

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 198 of file constants.hpp.

◆ root_three()

template<typename T>
T mx::math::root_three ( )
constexpr

Get the value of sqrt(3).

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 333 of file constants.hpp.

◆ root_two()

template<typename T>
T mx::math::root_two ( )
constexpr

Get the value of sqrt(2).

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 243 of file constants.hpp.

Referenced by mx::AO::analysis::pywfsModAsymptotic< realT, iosT >::beta_p(), mx::AO::analysis::pywfsUnmod< realT, iosT >::beta_p(), mx::math::func::expModGaussian(), and mx::sigproc::zernike().

◆ seventeen_thirds()

template<typename floatT>
floatT mx::math::seventeen_thirds ( )
constexpr

Return 17/3 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 520 of file constants.hpp.

◆ six_fifths()

template<typename floatT>
floatT mx::math::six_fifths ( )
constexpr

Return 6/5 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 498 of file constants.hpp.

Referenced by mx::AO::analysis::aoAtmosphere< _realT >::f_g(), mx::AO::analysis::aoAtmosphere< _realT >::r_0(), and mx::AO::analysis::aoAtmosphere< _realT >::tau_0().

◆ third()

template<typename T>
T mx::math::third ( )
constexpr

Get the value of 1/3.

Wrapper for boost constant. Specializations provided for float, double, and long double.

Definition at line 419 of file constants.hpp.

Referenced by mx::astro::orbitSemiMaj(), mx::astro::planetMass2Radius(), mx::astro::planetMass2RadiusFab2014(), and mx::astro::planetMass2RadiusWThorngren().

◆ three_fifths()

template<typename floatT>
floatT mx::math::three_fifths ( )
constexpr

Return 3/5 in the specified precision.

This constant is used frequently in adaptive optics analysis.

Definition at line 509 of file constants.hpp.

Referenced by mx::AO::analysis::aoAtmosphere< _realT >::layer_Cn2(), mx::AO::analysis::aoAtmosphere< _realT >::update_v_wind(), and mx::AO::analysis::aoAtmosphere< _realT >::update_z_mean().

◆ two_pi()

template<typename T>
T mx::math::two_pi ( )
constexpr

Get the value of 2pi.

Specializations provided for float, double, long double, and quad (if supported). Can default to boost for other types if MX_INCLUDE_BOOST is defined.

Definition at line 107 of file constants.hpp.

Referenced by mx::improc::angleImage(), mx::sigproc::ar1FreqPhase(), mx::sigproc::ar1PSD(), mx::sigproc::ar1PSD(), mx::sigproc::ar1PSDNorm(), mx::AO::sim::directPhaseReconstructor< realT >::calAmp(), mx::sigproc::comp_fourierModeDef(), continueAngles(), mx::AO::analysis::fourierPSDMap(), mx::AO::analysis::fourierVarVec(), mx::astro::getGMST(), mx::math::fit::guessGauss2D_ang(), mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::initGrid(), mx::AO::analysis::kInt(), mx::AO::analysis::zernikeCovariance< realT, aosysT >::kInt(), mx::sigproc::makeFourierModeC(), mx::sigproc::makeFourierModeS(), mx::sigproc::makeModifiedFourierMode(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::ncpError(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::ncpError(), mx::AO::analysis::clGainOpt< _realT >::olXfer(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::optimumTauWFS(), mx::astro::orbitMeanAnol(), mx::astro::orbitPeriod(), mx::astro::orbitSemiMaj(), mx::AO::analysis::phiInt_basic(), mx::sigproc::psdVarMeanFunc(), mx::improc::radAngImage(), mx::AO::sim::turbSubHarmonic< _turbAtmosphereT, _verboseT >::screen(), mx::AO::analysis::aoSystem< _realT, _inputSpectT, iosT >::timeDelayError(), mx::sigproc::zernikeQ(), and mx::sigproc::zernikeQNorm().