Legendre elliptic integrals (elliptic modulus \(k\)), and related functions#
For an overview see NIST [178], BoostMath [141], Mpmath [679].
Legendre complete elliptic integral of the first kind, \(K(k)\)#
- ctx.elliptic_k(k)#
where
ctxismath53,mathc53,ctxboostorctxflint.Returns the Legendre complete elliptic integral of the first kind, \(\displaystyle K(k) = \int_0^{\pi/2} \frac{\mathrm{d}t}{\sqrt{1-k^2 \sin^2(t)}}\). See also Wikipedia [1406], MathWorld [1025], NIST [178], BoostMath [143], Ehrhardt [309] (3.2.1.2), Ehrhardt [309] (4.2.30), Flint [815].
Left figure: real part of the Legendre complete elliptic integral of the first kind, \(K(k)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Legendre complete elliptic integral of the first kind, \(K(k)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Legendre complete elliptic integral of the first kind, \(K(k)\), with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Note: the original names are: math53.compEllint1(k), ctxboost.Ellint_1_K(k), mathc53.Ellk(k), ctx.ellipticK(k).
An example in Python
>>> from xlcalcnet import xreal >>> xreal.CompEllint1(0.5) xreal('5.2359877559829887307E-1') >>> xreal.CompEllint1('0.51') xreal('5.3518479027559984754E-1')An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.CompEllint1(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.CompEllint1('0.51') Gpr('5.3518479027559984754E-1')An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; m = '0.7' >>> \mathrm{d}x = dec.elliptic_k(m); mx = mpm.elliptic_k(m); gx = gmp.elliptic_k(m) >>> fx = fpm.elliptic_k(m); ax = apm.elliptic_k(m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 2.075363135292469143853440555882415805738E+0 mpm: 2.075363135292469143853440555882415805738e+0 gmp: 2.075363135292469143853440555882415805738E+00 fpm: 2.07536313529247E+00 apm: 2.075363135292469143853440555882415805738e+0 (5.531e-39%)An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_k(m); mz = mpm.elliptic_k(m); gz = gmp.elliptic_k(m) >>> fz = fpm.elliptic_k(m); az = apm.elliptic_k(m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 5.3766585026572650659E-1 + 7.1363115405781075467E-1j mpm: 5.3766585026572650659e-1 + 7.1363115405781075467e-1j gmp: 5.3766585026572650659E-01 + 7.1363115405781075467E-01j fpm: 5.37665850265727E-01 + 7.13631154057811E-01j apm: 5.3766585026572650659e-1 (1.575e-19%) + 7.1363115405781075467e-1 (1.187e-19%)j
Legendre complete elliptic integral of the second kind, \(E(k)\)#
- ctx.elliptic_e(k)#
where
ctxismath53,mathc53,ctxboostorctxflint.Note: the original names are: math53.compEllint2(k), ctxboost.Ellint_2_K(k), mathc53.Elle(k), ctx.ellipticE(k).
Returns the Legendre complete elliptic integral of the second kind, \(\displaystyle E(k) = \int_0^{\pi/2} \sqrt{1-k^2 \sin^2(t)} \, \mathrm{d}t\). See also Wikipedia [1407], MathWorld [1026], NIST [178], BoostMath [144], Ehrhardt [309] (3.2.1.2), Ehrhardt [309] (4.2.29), Flint [815].
Left figure: real part of the Legendre complete elliptic integral of the second kind, \(E(k)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Middle figure: imaginary part of the Legendre complete elliptic integral of the second kind, \(E(k)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
Right figure: absolute value of the Legendre complete elliptic integral of the second kind, \(E(k)\), with color-coded phase. Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.
An example in Python
>>> from xlcalcnet import xreal >>> xreal.CompEllint2(0.5) xreal('5.2359877559829887307E-1') >>> xreal.CompEllint2('0.51') xreal('5.3518479027559984754E-1')An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.CompEllint2(0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.CompEllint2('0.51') Gpr('5.3518479027559984754E-1')An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; m = '0.7' >>> \mathrm{d}x = dec.elliptic_e(m); mx = mpm.elliptic_e(m); gx = gmp.elliptic_e(m) >>> fx = fpm.elliptic_e(m); ax = apm.elliptic_e(m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 1.241670567945822750871511325172384427220E+0 mpm: 1.241670567945822750871511325172384427220e+0 gmp: 1.241670567945822750871511325172384427220E+00 fpm: 1.24167056794582E+00 apm: 1.241670567945822750871511325172384427220e+0 (3.051e-38%)An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_e(m); mz = mpm.elliptic_e(m); gz = gmp.elliptic_e(m) >>> fz = fpm.elliptic_e(m); az = apm.elliptic_e(m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 7.2362394000819105306E-1 - 2.9177047805082638786E+0j mpm: 7.2362394000819105306e-1 - 2.9177047805082638786e+0j gmp: 7.2362394000819105306E-01 - 2.9177047805082638786E+00j fpm: 7.23623940008191E-01 - 2.91770478050826E+00j apm: 7.2362394000819105306e-1 (2.517e-18%) - 2.9177047805082638786e+0 (-6.967e-19%)j
Legendre complete elliptic integral of the third kind, \(\Pi(n; k)\)#
- ctx.elliptic_pi(n, k)#
where
ctxismath53,ctxboostorctxflint.The original names are: math53.compEllint3(n, k), ctxboost.Ellint3K(n, k), ctx.ellipticPi(n, k).
Returns the Legendre complete elliptic integral of the third kind, \(\displaystyle \Pi(n; k) = \int_0^{\pi/2} \frac{\mathrm{d}t}{(1-n \sin^2(t)) \sqrt{1-k^2 \sin^2(t)}}\). See also Wikipedia [1408], MathWorld [1027], NIST [178], BoostMath [145], Ehrhardt [309] (3.2.1.3), Flint [815].
An example in Python
>>> from xlcalcnet import xreal >>> xreal.CompEllint3(3, 0.5) xreal('5.2359877559829887307E-1') >>> xreal.CompEllint3(3, 0.5) xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.CompEllint3(3, 0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.CompEllint3(3, 0.5) Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; n = '0.3'; m = '0.7' >>> \mathrm{d}x = dec.elliptic_pi(n, m); mx = mpm.elliptic_pi(n, m); gx = gmp.elliptic_pi(n, m) >>> fx = fpm.elliptic_pi(n, m); ax = apm.elliptic_pi(n, m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 2.547020657187356856228799375719809427641E+0 mpm: 2.547020657187356856228799375719809427641e+0 gmp: 2.547020657187356856228799375719809427641E+00 fpm: 2.54702065718736E+00 apm: (2.547020657187356856228799375719809427641e+0 (1.803e-39%) + 0.0e+0 (0.0%)j)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; n = '7.0 + 3.0j'; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_pi(n, m); mz = mpm.elliptic_pi(n, m); gz = gmp.elliptic_pi(n, m) >>> fz = fpm.elliptic_pi(n, m); az = apm.elliptic_pi(n, m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 2.1895146240011771984E-2 + 3.3171027919457516393E-1j mpm: 2.1895146240011771984e-2 + 3.3171027919457516393e-1j gmp: 2.1895146240011771984E-02 + 3.3171027919457516393E-01j fpm: 2.18951462400118E-02 + 3.31710279194575E-01j apm: 2.1895146240011771984e-2 (1.142e-17%) + 3.3171027919457516393e-1 (8.299e-19%)j
Legendre incomplete elliptic integral of the first kind, \(F(\phi,k)\)#
- ctx.elliptic_f(phi, k)#
where
ctxismath53,ctxboostorctxflint.The original names are: math53.ellint1(phi, k), ctxboost.Ellint1F(phi, k), ctx.ellipticF(phi, k),
Returns the Legendre incomplete elliptic integral of the first kind, \(\displaystyle F(\phi,k) = \int_0^{\phi} \frac{\mathrm{d}t}{\sqrt{1-k^2 \sin^2(t)}}\). See also Wikipedia [1414], MathWorld [1034], NIST [178], BoostMath [143], Ehrhardt [309] (3.2.1.6), Flint [819], Mpmath [680].
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Ellint1(0.12, 0.5) xreal('5.2359877559829887307E-1') >>> xreal.Ellint1(0.12, 0.5) xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Ellint1(0.12, 0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Ellint1(0.12, 0.5) Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; phi = '0.3'; m = '0.7' >>> \mathrm{d}x = dec.elliptic_f(phi, m); mx = mpm.elliptic_f(phi, m); gx = gmp.elliptic_f(phi, m) >>> fx = fpm.elliptic_f(phi, m); ax = apm.elliptic_f(phi, m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 3.031825967528964316037861066816046200412E-1 mpm: 3.031825967528964316037861066816046200412e-1 gmp: 3.031825967528964316037861066816046200412E-01 fpm: 3.03182596752896E-01 apm: 3.031825967528964316037861066816046200412e-1 (1.893e-39%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; phi = '7.0 + 3.0j'; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_f(phi, m); mz = mpm.elliptic_f(phi, m); gz = gmp.elliptic_f(phi, m) >>> fz = fpm.elliptic_f(phi, m); az = apm.elliptic_f(phi, m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 2.2337086166522330643E+0 + 3.6096091763407986549E+0j mpm: 2.2337086166522330643e+0 + 3.6096091763407986549e+0j gmp: 2.2337086166522330643E+00 + 3.6096091763407986549E+00j fpm: 2.23370861665223E+00 + 3.60960917634080E+00j apm: 2.2337086166522330643e+0 (1.441e-18%) + 3.6096091763407986549e+0 (8.917e-19%)j
Legendre incomplete elliptic integral of the second kind, \(E(\phi,k)\)#
- ctx.elliptic_e_inc(phi, k)#
where
ctxismath53,ctxboostorctxflint.The original names are: math53.ellint2(phi, k), ctxboost.Ellint2E(phi, k), ctx.ellipticEInc(phi, k).
Returns the Legendre incomplete elliptic integral of the second kind, \(\displaystyle E(\phi,k) = \int_0^{\phi} \sqrt{1-k^2 \sin^2(t)} \, \mathrm{d}t\). See also Wikipedia [1415], MathWorld [1035], NIST [178], BoostMath [144], Ehrhardt [309] (3.2.1.7), Flint [819], Mpmath [689].
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Ellint2(0.12, 0.5) xreal('5.2359877559829887307E-1') >>> xreal.Ellint2(0.12, 0.5) xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Ellint2(0.12, 0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Ellint2(0.12, 0.5) Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; phi = '0.3'; m = '0.7' >>> \mathrm{d}x = dec.elliptic_e_inc(phi, m); mx = mpm.elliptic_e_inc(phi, m); gx = gmp.elliptic_e_inc(phi, m) >>> fx = fpm.elliptic_e_inc(phi, m); ax = apm.elliptic_e_inc(phi, m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 2.968770545017986339483352218840387692991E-1 mpm: 2.968770545017986339483352218840387692991e-1 gmp: 2.968770545017986339483352218840387692991E-01 fpm: 2.96877054501799E-01 apm: 2.968770545017986339483352218840387692991e-1 (1.933e-39%)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; phi = '7.0 + 3.0j'; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_e_inc(phi, m); mz = mpm.elliptic_e_inc(phi, m); gz = gmp.elliptic_e_inc(phi, m) >>> fz = fpm.elliptic_e_inc(phi, m); az = apm.elliptic_e_inc(phi, m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 2.2018638848426980990E+1 + 1.3783034022089380754E+1j mpm: 2.2018638848426980990e+1 + 1.3783034022089380754e+1j gmp: 2.2018638848426980990E+01 + 1.3783034022089380754E+01j fpm: 2.20186388484270E+01 + 1.37830340220894E+01j apm: 2.2018638848426980990e+1 (8.617e-19%) + 1.3783034022089380754e+1 (1.377e-18%)j
Legendre incomplete elliptic integral of the third kind, \(\Pi(n, \phi, k)\)#
- ctx.elliptic_pi_inc(n, phi, k)#
where
ctxismath53,ctxboostorctxflint.The original names are: math53.ellint3(phi, n, k), ctxboost.Ellint3F(phi, n, k), ctx.ellipticPiInc(phi, n, k).
Returns the Legendre incomplete elliptic integral of the third kind, \(\displaystyle \Pi(n, \phi, k) = \int_0^{\phi} \frac{\mathrm{d}t}{(1-n \sin^2(t)) \sqrt{1-k^2 \sin^2(t)}}\). See also Wikipedia [1416], MathWorld [1036], NIST [178], BoostMath [145], Ehrhardt [309] (3.2.1.8), Flint [819], Mpmath [690].
An example in Python
>>> from xlcalcnet import xreal >>> xreal.Ellint3(0.3, 0.12, 0.5) xreal('5.2359877559829887307E-1') >>> xreal.Ellint3(0.3, 0.12, 0.5) xreal('5.3518479027559984754E-1')
An example in Visual Basic
>>> from xlcalcnet import Gpr >>> Gpr.Ellint3(0.3, 0.12, 0.5) Gpr('5.2359877559829887307E-1') >>> Gpr.Ellint3(0.3, 0.12, 0.5) Gpr('5.3518479027559984754E-1')
An example with real input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 40; n = '0.6'; phi = '0.3'; m = '0.7' >>> \mathrm{d}x = dec.elliptic_pi_inc(n, phi, m); mx = mpm.elliptic_pi_inc(n, phi, m); >>> gx = gmp.elliptic_pi_inc(n, phi, m) >>> fx = fpm.elliptic_pi_inc(n, phi, m); ax = apm.elliptic_pi_inc(n, phi, m) >>> mpm.show([\mathrm{d}x, mx, gx, fx, ax]) dec: 3.087654946778377288030230685950811138212E-1 mpm: 3.087654946778377288030230685950811138212e-1 gmp: 3.087654946778377288030230685950811138212E-01 fpm: 6.49290594268217E-01 apm: (3.087654946778377288030230685950811138212e-1 (1.859e-39%) + 0.0e+0 (0.0%)j)
An example with complex input:
>>> from xlcalcnet import dec, mpm, gmp, fpm, apm >>> mpm.dps = 20; n = '5.0 + 2.0j'; phi = '7.0 + 3.0j'; m = '11.0 + 3.0j' >>> \mathrm{d}z = dec.elliptic_pi_inc(n, phi, m); mz = mpm.elliptic_pi_inc(n, phi, m); >>> gz = gmp.elliptic_pi_inc(n, phi, m) >>> fz = fpm.elliptic_pi_inc(n, phi, m); az = apm.elliptic_pi_inc(n, phi, m) >>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True) dec: 8.9235627651336744287E-2 + 1.8343289835828317105E+0j mpm: 8.9235627651336744287e-2 + 1.8343289835828317105e+0j gmp: 8.9235627651336744287E-02 + 1.8343289835828317105E+00j fpm: 8.92356276513367E-02 + 1.83432898358283E+00j apm: 8.9235627651336744288e-2 (4.509e-17%) + 1.8343289835828317105e+0 (2.309e-18%)j





