From 950b220bb4a42727a5676ca5170a6fa4c135b1e5 Mon Sep 17 00:00:00 2001 From: jtlap Date: Thu, 28 Sep 2023 23:06:06 +0200 Subject: [PATCH] remaining functions --- doc/index.md | 28 +++++++++++---------- include/kyosu/complex/lrising_factorial.hpp | 2 +- include/kyosu/complex/tgamma.hpp | 2 +- include/kyosu/complex/zeta.hpp | 9 +++---- include/kyosu/functions/cosh.hpp | 2 +- include/kyosu/functions/from_angle_axis.hpp | 2 +- include/kyosu/functions/log.hpp | 2 +- include/kyosu/functions/rotate_vec.hpp | 3 ++- include/kyosu/functions/sqrt.hpp | 2 +- include/kyosu/functions/tan.hpp | 12 ++++++--- include/kyosu/functions/tanh.hpp | 21 +++++++++++++++- include/kyosu/functions/trunc.hpp | 2 +- 12 files changed, 57 insertions(+), 30 deletions(-) diff --git a/doc/index.md b/doc/index.md index 685ca77a..49e2b891 100644 --- a/doc/index.md +++ b/doc/index.md @@ -79,20 +79,22 @@ Constructors complex and quaternion can be constructed using callables facilities `complex` and `quaternion`. -complex can also be constructed from their polar representation +complex can also be constructed from their polar representation\n quaternion from various parametrizations of \f$\mathbb{R}^4\f$ or from \f$\mathbb{R}^3\f$ rotations: - * angle and axis: from_angle_axis.hpp - * cylindrical: from_cylindrical - * cylindricospherical: from_cylindricospherical - * euler: from_eule - * multipolar: from_multipolar - * rotationmatrix: from_rotation_matrix - * semipolar: from_semipolar - * spherical: from_spherical - * two vectors: align - -each of the from_xxx functions has a corresponding to_xxx version that gives back the + | | | | + |-------------------------|-----------------------------------------------------------------|-------------------------------------------------------------| + | angle and axis | [from_angle_axis](@ref kyosu::from_angle_axis ) | [to_angle_axis](@ref kyosu::to_angle_axis ) | + | cylindrical | [from_cylindrical](@ref kyosu::from_cylindrical ) | [to_cylindrical](@ref kyosu::to_cylindrical ) | + | cylindricospherical | [from_cylindrospherical](@ref kyosu::from_cylindrospherical ) | [to_cylindrospherical](@ref kyosu::to_cylindrospherical ) | + | euler | [from_euler](@ref kyosu::from_euler ) | [to_euler](@ref kyosu::to_euler ) | + | multipolar | [from_multipolar](@ref kyosu::from_multipolar ) | [to_multipolar](@ref kyosu::to_multipolar ) | + | rotation matrix | [from_rotation_matrix](@ref kyosu::from_rotation_matrix ) | [to_rotation_matrix](@ref kyosu::to_rotation_matrix ) | + | semipolar | [from_semipolar](@ref kyosu::from_semipolar ) | [to_semipolar](@ref kyosu::to_semipolar ) | + | spherical | [from_spherical](@ref kyosu::from_spherical ) | [to_spherical](@ref kyosu::to_spherical ) | + | two vectors | [align](@ref kyosu::align ) | | + +The third column references to the corresponding to_xxx version that gives back the chosen representation from a quaternion input. TODO cayley_dickson construction @@ -158,7 +160,7 @@ complex functions and rotation related quaternion usage. |------------------|------------------|--------------------|------------------|---------------| | [beta](@ref kyosu::beta ) | [deta](@ref kyosu::deta ) | [digamma](@ref kyosu::digamma ) | [erf](@ref kyosu::erf ) | [erfcx](@ref kyosu::erfcx ) | | [erfi](@ref kyosu::erfi ) | [eta](@ref kyosu::eta ) | [faddeeva](@ref kyosu::faddeeva ) | [lambda](@ref kyosu::lambda ) | [lbeta](@ref kyosu::lbeta ) | - | [log_abs_gamma](@ref kyosu::log_abs_gamma ) | [log_gamma](@ref kyosu::log_gamma ) | [lrising_factorial](@ref kyosu:lrising_factorial ) | [rising_factorial](@ref kyosu::rising_factorial ) | [tgamma](@ref kyosu::tgamma ) | + | [log_abs_gamma](@ref kyosu::log_abs_gamma ) | [log_gamma](@ref kyosu::log_gamma ) | [lrising_factorial](@ref kyosu::lrising_factorial ) | [rising_factorial](@ref kyosu::rising_factorial ) | [tgamma](@ref kyosu::tgamma ) | | [zeta](@ref kyosu::zeta ) | | | | | * callables usable with quaternion complex and real only diff --git a/include/kyosu/complex/lrising_factorial.hpp b/include/kyosu/complex/lrising_factorial.hpp index 5d1f19f7..287beec5 100644 --- a/include/kyosu/complex/lrising_factorial.hpp +++ b/include/kyosu/complex/lrising_factorial.hpp @@ -73,7 +73,7 @@ namespace kyosu //! //! **Return value** //! -//! @brief Computes the Rising Factorial function i.e. \f$\log\frac{\Gamma(x+y)}{\Gamma(x)}\f$. +//! @brief Computes the logarithm Rising Factorial function i.e. \f$\log\frac{\Gamma(x+y)}{\Gamma(x)}\f$. //! //! @groupheader{Example} //! diff --git a/include/kyosu/complex/tgamma.hpp b/include/kyosu/complex/tgamma.hpp index 86219211..4709cc02 100644 --- a/include/kyosu/complex/tgamma.hpp +++ b/include/kyosu/complex/tgamma.hpp @@ -65,7 +65,7 @@ namespace kyosu //! //! **Return value** //! -//! Returns \f$\Gamma(z)\f$. If z is floating the result is as if complex(z) was used in the call. +//! Returns \f$\Gamma(z)\f$. //! //! @groupheader{Example} //! diff --git a/include/kyosu/complex/zeta.hpp b/include/kyosu/complex/zeta.hpp index 2f69b61a..b383f962 100644 --- a/include/kyosu/complex/zeta.hpp +++ b/include/kyosu/complex/zeta.hpp @@ -43,7 +43,7 @@ namespace kyosu //! @addtogroup functions //! @{ //! @var zeta -//! @brief Computes the Riemann \f$\zeta\f$ \f$ \displaystyle \sum_0^\infty \frac{1}{(n+1)^z}\f$. +//! @brief Computes the Riemann \f$ \displaystyle\zeta(z)=\sum_0^\infty \frac{1}{(n+1)^z}\f$. //! //! **Defined in Header** //! @@ -56,19 +56,18 @@ namespace kyosu //! @code //! namespace kyosu //! { -//! template constexpr auto zeta(K, k, T z) noexcept; //1 -//! template constexpr auto zeta(K, k, T z) noexcept; //2 +//! template constexpr auto zeta(T z) noexcept; +//! template constexpr auto zeta(T z) noexcept; //! } //! @endcode //! //! **Parameters** //! -//! * `k` : scalar unsigned value, parameter of the sum. //! * `z` : complex or real value to process. //! //! **Return value** //! -//! Returns the Dirichlet alternating zzeta function: sum \f$ \displaystyle \sum_0^\infty \frac{1}{(n+1)^z}\f$ +//! Returns the Dirichlet zeta function: \f$ \displaystyle \sum_0^\infty \frac{1}{(n+1)^z}\f$ //! //! @groupheader{Example} //! diff --git a/include/kyosu/functions/cosh.hpp b/include/kyosu/functions/cosh.hpp index 1edbdc3d..b1d5b6ac 100644 --- a/include/kyosu/functions/cosh.hpp +++ b/include/kyosu/functions/cosh.hpp @@ -65,7 +65,7 @@ namespace kyosu //! //! **Return value** //! -//! 2. Returns [elementwise](@ref glossary_elementwise) the complex value +//! 2. Returns elementwise the complex value //! of the hyperbolic cosine of the input. //! //! * for every z: `kyosu::cosh(kyosu::conj(z)) == kyosu::conj(std::cosh(z))` diff --git a/include/kyosu/functions/from_angle_axis.hpp b/include/kyosu/functions/from_angle_axis.hpp index 108667f3..9d376123 100644 --- a/include/kyosu/functions/from_angle_axis.hpp +++ b/include/kyosu/functions/from_angle_axis.hpp @@ -48,7 +48,7 @@ namespace kyosu::tags namespace kyosu { //================================================================================================ - //! @addtogroup quaternion + //! @addtogroup functions //! @{ //! @var from_angle_axis //! diff --git a/include/kyosu/functions/log.hpp b/include/kyosu/functions/log.hpp index 7858dd88..f74dee9c 100644 --- a/include/kyosu/functions/log.hpp +++ b/include/kyosu/functions/log.hpp @@ -71,7 +71,7 @@ namespace kyosu //! //! 1. a real typed input z is treated as if [kyosu::complex](@ref kyosu::complex)(z) was entered. //! -//! 2. Returns [elementwise](@ref glossary_elementwise) the natural logarithm of the input +//! 2. Returns elementwise the natural logarithm of the input //! in the range of a strip in the interval \f$i\times[-\pi, \pi]\f$ along the imaginary axis //! and mathematically unbounded along the real axis. . //! diff --git a/include/kyosu/functions/rotate_vec.hpp b/include/kyosu/functions/rotate_vec.hpp index 6adb11ca..07c3f1db 100644 --- a/include/kyosu/functions/rotate_vec.hpp +++ b/include/kyosu/functions/rotate_vec.hpp @@ -87,7 +87,8 @@ namespace kyosu //! **Parameters** //! //! `q`: quaternion value defining the rotation. - //! `x`: span of 3 elements to rotate. + //! + //! `v`: span of 3 elements to rotate. //! //! **Return value** //! diff --git a/include/kyosu/functions/sqrt.hpp b/include/kyosu/functions/sqrt.hpp index 531f7289..a06f3071 100644 --- a/include/kyosu/functions/sqrt.hpp +++ b/include/kyosu/functions/sqrt.hpp @@ -71,7 +71,7 @@ namespace kyosu //! //! 1. a real typed input z is treated as if [kyosu::complex](@ref kyosu::complex)(z) was entered. //! -//! 2. Returns the [elementwise](@ref glossary_elementwise) the square root of z, +//! 2. Returns the elementwise the square root of z, //! in the range of the right half-plane, including the imaginary axis (\f$[0, +\infty]\f$ //! along the real axis and \f$[-\infty, +\infty]\f$ along the imaginary axis.) //! diff --git a/include/kyosu/functions/tan.hpp b/include/kyosu/functions/tan.hpp index bc35aa20..07ed7dc2 100644 --- a/include/kyosu/functions/tan.hpp +++ b/include/kyosu/functions/tan.hpp @@ -52,8 +52,9 @@ namespace kyosu //! @code //! namespace kyosu //! { -//! template constexpr T tan(T z) noexcept; -//! template constexpr T tan(T z) noexcept; +//! template constexpr T tan(T z) noexcept; //1 +//! template constexpr T tan(T z) noexcept; //2 +//! template constexpr T tan(T z) noexcept; //3 //! } //! @endcode //! @@ -63,7 +64,12 @@ namespace kyosu //! //! **Return value** //! -//! Returns the tangent of the argument. +//! 1. Returns eve::tan(z) +//! +//! 2. The behavior of this function is equivalent to \f$-i\tanh(i\; z)\f$. +//! +//! 3. Returns \f$-I_z\,; \tanh(I_z\; z)\f$ if \f$z\f$ is not zero else \f$\tan(z_0)\f$, where \f$I_z = \frac{\underline{z}}{|\underline{z}|}\f$ and +//! \f$\underline{z}\f$ is the [pure](@ref kyosu::imag ) part of \f$z\f$. //! //! @groupheader{Example} //! diff --git a/include/kyosu/functions/tanh.hpp b/include/kyosu/functions/tanh.hpp index 194c54e8..fc20bd97 100644 --- a/include/kyosu/functions/tanh.hpp +++ b/include/kyosu/functions/tanh.hpp @@ -63,7 +63,26 @@ namespace kyosu //! //! **Return value** //! -//! Returns the hyperbolic tangent of the argument. +//! 1. Returns eve::tanh(z). +//! +//! 2. Returns elementwise the complex value +//! of the hyperbolic tangent of the input. +//! +//! * for every z: `kyosu::tanh(kyosu::conj(z)) == kyosu::conj(std::tanh(z))` +//! * for every z: `kyosu::tanh(-z) == -kyosu::tanh(z)` +//! * If z is \f$+0\f$, the result is \f$+0\f$ +//! * If z is \f$x+i \infty\f$ (for any non zero finite x), the result is \f$NaN+i NaN\f$ +//! * If z is \f$i \infty\f$ the result is \f$i NaN\f$ +//! * If z is \f$x,NaN\f$ (for any non zero finite x), the result is \f$NaN+i NaN\f$ +//! * If z is \f$i NaN\f$ the result is \f$i NaN\f$ +//! * If z is \f$+\infty,y\f$ (for any finite positive y), the result is \f$1\f$ +//! * If z is \f$+\infty+i \infty\f$, the result is \f$1,\pm 0\f$ (the sign of the imaginary part is unspecified) +//! * If z is \f$+\infty+i NaN\f$, the result is \f$1\f$ (the sign of the imaginary part is unspecified) +//! * If z is \f$NaN\f$, the result is \f$NaN\f$ +//! * If z is \f$NaN+i y\f$ (for any non-zero y), the result is \f$NaN+i NaN\f$ +//! * If z is \f$NaN+i NaN\f$, the result is \f$NaN+i NaN\f$ +//! +//! 3. The call is semantically equivalent to sinh(z)/cosh(z); //! //! @groupheader{Example} //! diff --git a/include/kyosu/functions/trunc.hpp b/include/kyosu/functions/trunc.hpp index 4850c5f5..810ccbaa 100644 --- a/include/kyosu/functions/trunc.hpp +++ b/include/kyosu/functions/trunc.hpp @@ -52,7 +52,7 @@ namespace kyosu //! namespace kyosu //! { //! template constexpr T trunc(T z) noexcept; -//! template constexpr T trunc(T z) noexcept; +//! template constexpr T trunc(T z) noexcept; //! } //! @endcode //!