Learn R Programming

PlaneGeometry (version 1.1.0)

ellint2: Extended elliptic integral of the second kind

Description

Evaluates the extended incomplete elliptic integral of the second kind. The function is vectorized in m but not in phi.

Usage

ellint2(phi, m)

Arguments

phi

amplitude, a number

m

values of the parameter, a vector of numbers lower than 1/sin(phi)^2 (NaN is returned if this condition is not satisfied)

Value

A numeric vector of the same length as m.

Details

For -pi/2 <= phi <= pi/2, this is the integral of sqrt(1 - m*sin(t)^2) for t between 0 and phi. Then the function is extended to arbitrary phi by the formula ellint2(phi + k*pi, m) = 2*k*ellint2(pi/2, m) + ellint2(phi, m) for any integer k.

Examples

Run this code
# NOT RUN {
phi <- pi/4; m <- 0.6
ellint2(phi, m)
gsl::ellint_E(phi, sqrt(m))
curve(ellint2(phi, x), -5, 1/sin(phi)^2)
# }

Run the code above in your browser using DataLab