jn
-
constexpr Complex jn(const int n, const Complex &z) noexcept
Evaluates the Bessel function of the first kind [1] for a complex input and integer order.
Parameters
- const int n
An integer.
- const Complex &z
A complex number.
Returns
- type Complex
A complex number.
The Bessel functions of the first kind are the solutions to the following differential equation:
\[x^2 \frac{d^2y}{dx^2} + x \frac{dy}{dx} + (x^2 - n^2) = 0\]
For an integer order \(n\), the following integral representation [2] can be used:
\[J_n(z) = \frac{1}{\pi}\int_{0}{\pi}\cos(z\sin(\theta) - n\theta)d\theta\]
Example
int n = 1;
Complex z = 1_j;
std::cout << jn(n, z) << "\n";
Output:
1.87315e-17 + 0.565159j
References