Loading [MathJax]/extensions/tex2jax.js
kyosu v0.1.0
Complex Without Complexes
 
All Classes Namespaces Functions Variables Typedefs Modules Pages Concepts
Loading...
Searching...
No Matches

◆ am

kyosu::am = eve::functor<am_t>
inlineconstexpr

Computes Jacobi's Amplitude function.

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
// Regular overload
template <complex_like Z, floating_value U> constexpr auto am(Z z, U m) noexcept; //1
//Semantic modifiers
template <complex_like Z, floating_value U> constexpr auto am[modular](Z z, U alpha) noexcept; //1
template <complex_like Z, floating_value U> constexpr auto am[eccentric](Z z, U k) noexcept; //1
constexpr auto am[threshold = tol](/*any previous overload*/) noexcept; //1
}
constexpr auto k
Computes the complex number k i.e. quaternion(0, 0, 0, 1) in the chosen type.
Definition: k.hpp:72
constexpr auto am
Computes Jacobi's Amplitude function.
Definition: am.hpp:91
Main KYOSU namespace.
Definition: cinf.hpp:13

Parameters

  • u: argument.
  • m: amplitude parameter ( \(0\le m\le 1\)).
  • alpha: modular angle in radian.
  • k: elliptic modulus (eccentricity) .
  • ‘tol’: accuracy tolerance (by defaut epsilon.
  • c: Conditional expression masking the operation.
  • l: Logical value masking the operation.

Return value

  1. return the jacobian amplitude function. Take care that the meaning of the second parameters depends on the option used (see note below).
Note
  • \(\alpha\) is named the modular angle given in radian (modular option).
  • \( k = \sin\alpha \) is named the elliptic modulus or eccentricity (eccentric option).
  • \( m = k^2 = \sin^2\alpha\) is named the parameter (no option).Currentlty it must belong to \([0 1]\). Each of the above three quantities is completely determined by any of the others (given that they are non-negative). Thus, they can be used interchangeably up to roundings errors by giving the right option.

External references

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
double pio_2 = eve::pio_2(eve::as<double>());
auto i = kyosu::i(eve::as<double>());
std::cout << "am(2.0, 0.5) "<< kyosu::am(2.0, 0.5) << std::endl;
std::cout << "am(2.0, 0.9) "<< kyosu::am(2.0, 0.9) << std::endl;
std::cout << "am[modular](2.0, pio_2) "<< kyosu::am[eve::modular](2.0, pio_2) << std::endl;
std::cout << "am[modular](2.0, 0.5) "<< kyosu::am[eve::modular](2.0, 0.5) << std::endl;
std::cout << "am[eccentric](2.0, 0.5) "<< kyosu::am[eve::eccentric](2.0, 0.5) << std::endl;
std::cout << "am[eccentric](2.0, 0.9) "<< kyosu::am[eve::eccentric](2.0, 0.9) << std::endl;
eve::wide phi{2.0+0*i, 2.0+0*i, 1.+2*i, i};
eve::wide m {0.5, 0.9, 0.1, 0.2};
std::cout << "phi " << phi << std::endl;
std::cout << "m " << m << std::endl;
std::cout << "am[eccentric](phi, m) " << kyosu::am[eve::eccentric](phi, m) << std::endl;
return 0;
}
constexpr auto i
Computes the complex number in the chosen type.
Definition: i.hpp:69