tangxu
2022-10-31 8ea88fedd51e4961d0fd0aec6c2873a579fb6db8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using Complex = System.Numerics.Complex;
 
namespace IStation.Numerics
{
    /// <summary>
    /// This partial implementation of the SpecialFunctions class contains all methods related to the Hankel function.
    /// </summary>
    public static partial class SpecialFunctions
    {
        /// <summary>
        /// Returns the Hankel function of the first kind.
        /// <para>HankelH1(n, z) is defined as BesselJ(n, z) + j * BesselY(n, z).</para>
        /// </summary>
        /// <param name="n">The order of the Hankel function.</param>
        /// <param name="z">The value to compute the Hankel function of.</param>
        /// <returns>The Hankel function of the first kind.</returns>
        public static Complex HankelH1(double n, Complex z)
        {
            return Amos.Cbesh1(n, z);
        }
 
        /// <summary>
        /// Returns the exponentially scaled Hankel function of the first kind.
        /// <para>ScaledHankelH1(n, z) is given by Exp(-z * j) * HankelH1(n, z) where j = Sqrt(-1).</para>
        /// </summary>
        /// <param name="n">The order of the Hankel function.</param>
        /// <param name="z">The value to compute the Hankel function of.</param>
        /// <returns>The exponentially scaled Hankel function of the first kind.</returns>
        public static Complex HankelH1Scaled(double n, Complex z)
        {
            return Amos.ScaledCbesh1(n, z);
        }
 
        /// <summary>
        /// Returns the Hankel function of the second kind.
        /// <para>HankelH2(n, z) is defined as BesselJ(n, z) - j * BesselY(n, z).</para>
        /// </summary>
        /// <param name="n">The order of the Hankel function.</param>
        /// <param name="z">The value to compute the Hankel function of.</param>
        /// <returns>The Hankel function of the second kind.</returns>
        public static Complex HankelH2(double n, Complex z)
        {
            return Amos.Cbesh2(n, z);
        }
 
        /// <summary>
        /// Returns the exponentially scaled Hankel function of the second kind.
        /// <para>ScaledHankelH2(n, z) is given by Exp(z * j) * HankelH2(n, z) where j = Sqrt(-1).</para>
        /// </summary>
        /// <param name="n">The order of the Hankel function.</param>
        /// <param name="z">The value to compute the Hankel function of.</param>
        /// <returns>The exponentially scaled Hankel function of the second kind.</returns>
        public static Complex HankelH2Scaled(double n, Complex z)
        {
            return Amos.ScaledCbesh2(n, z);
        }
    }
}