:mod:`constants` --- Mathematical constants =========================================== .. module:: constants This module contains some common mathematical constants, implement as ``constexpr double`` variables. Standard POSIX constants ------------------------ If the `standard POSIX mathematical constants`_ are defined as macros, this modules undefines them. These constant are reintroduced in the namespace ``polder::math``, no matter whether they were already defined as macros. .. cpp:var:: constexpr double math::M_E Value of :math:`e`. .. cpp:var:: constexpr double math::M_LOG2E Value of :math:`\log_2{e}`. .. cpp:var:: constexpr double math::M_LOG10E Value of :math:`\log_{10}{e}`. .. cpp:var:: constexpr double math::M_LN2 Value of :math:`\ln{2}`. .. cpp:var:: constexpr double math::M_LN10 Value of :math:`\ln{10}`. .. cpp:var:: constexpr double math::M_PI Value of :math:`\pi`. .. cpp:var:: constexpr double math::M_PI_2 Value of :math:`\pi/2`. .. cpp:var:: constexpr double math::M_PI_4 Value of :math:`\pi/4`. .. cpp:var:: constexpr double math::M_1_PI Value of :math:`1/\pi`. .. cpp:var:: constexpr double math::M_2_PI Value of :math:`2/\pi`. .. cpp:var:: constexpr double math::M_2_SQRTPI Value of :math:`2/\sqrt{\pi}`. .. cpp:var:: constexpr double math::M_SQRT2 Value of :math:`\sqrt{2}`. .. cpp:var:: constexpr double math::M_SQRT1_2 Value of :math:`1/\sqrt{2}`. Unit circle constants --------------------- .. cpp:var:: constexpr double math::M_PI_3 Value of :math:`\pi/3`. .. cpp:var:: constexpr double math::M_PI_6 Value of :math:`\pi/6`. .. cpp:var:: constexpr double math::M_2PI_3 Value of :math:`2*\pi/3`. .. cpp:var:: constexpr double math::M_3PI_4 Value of :math:`3*\pi/4`. .. cpp:var:: constexpr double math::M_5PI_6 Value of :math:`5*\pi/6`. .. cpp:var:: constexpr double math::M_7PI_6 Value of :math:`7*\pi/6`. .. cpp:var:: constexpr double math::M_5PI_4 Value of :math:`5*\pi/4`. .. cpp:var:: constexpr double math::M_4PI_3 Value of :math:`4*\pi/3`. .. cpp:var:: constexpr double math::M_5PI_3 Value of :math:`5*\pi/3`. .. cpp:var:: constexpr double math::M_7PI_4 Value of :math:`7*\pi/4`. .. cpp:var:: constexpr double math::M_11PI_6 Value of :math:`11*\pi/6`. .. cpp:var:: constexpr double math::M_SQRT2_2 Value of :math:`\sqrt{2}/2`. .. cpp:var:: constexpr double math::M_SQRT2_3 Value of :math:`\sqrt{2}/3`. Other common constants ---------------------- .. cpp:var:: constexpr double math::M_PHI Value of :math:`\phi`. .. cpp:var:: constexpr double math::M_SQRT3 Value of :math:`\sqrt{3}`. .. cpp:var:: constexpr double math::M_PI_180 Value of :math:`\pi/180`. .. cpp:var:: constexpr double math::M_180_PI Value of :math:`180/\pi`. .. cpp:var:: constexpr double math::M_2PI Value of :math:`2*\pi`. .. _standard POSIX mathematical constants: http://www.gnu.org/software/libc/manual/html_mono/libc.html#Mathematical-Constants