Expand description
§ELLIP
Ellip is an elliptic integral functions for Rust.
§Why Ellip
Ellip is a pure-Rust implementation of elliptic integrals.
This means there is no dependence on C++ libraries. Ellip also provides less common
functions like Bulirsch’s cel
and el
. Some applications of elliptic integrals include
computing the lengths of plane curves, magnetic field from
magnets of various shapes (e.g., cylindrical),
astrophysics, and string theory.
§Example
Computing the circumference of an ellipse.
use ellip::*;
fn ellipse_length(a: f64, b: f64) -> Result<f64, StrErr> {
Ok(8.0 * elliprg(0.0, a * a, b * b)?)
}
let ans = ellipse_length(5.0, 3.0).unwrap();
ellip::util::assert_close(ans, 25.526998863398124, 1e-15);
§Features
§Legendre’s complete integrals
- ellipk: Complete elliptic integral of the first kind (K).
- ellipe: Complete elliptic integral of the second kind (E).
- ellippi: Complete elliptic integral of the third kind (Π).
- ellipd: Complete elliptic integral of Legendre’s type (D).
§Legendre’s incomplete integrals
- ellipf: Incomplete elliptic integral of the first kind (F).
- ellipeinc: Incomplete elliptic integral of the second kind (E).
- ellippiinc: Incomplete elliptic integral of the third kind (Π).
- ellipdinc: Incomplete elliptic integral of Legendre’s type (D).
§Bulirsch’s integrals
- cel: General complete elliptic integral in Bulirsch’s form.
- cel1: Complete elliptic integral of the first kind in Bulirsch’s form.
- cel2: Complete elliptic integral of the second kind in Bulirsch’s form.
- el1: Incomplete elliptic integral of the first kind in Bulirsch’s form.
- el2: Incomplete elliptic integral of the second kind in Bulirsch’s form.
- el3: Incomplete elliptic integral of the third kind in Bulirsch’s form.
§Carlson’s symmetric integrals
- elliprf: Symmetric elliptic integral of the first kind (RF).
- elliprg: Symmetric elliptic integral of the second kind (RG).
- elliprj: Symmetric elliptic integral of the third kind (RJ).
- elliprc: Degenerate elliptic integral of RF (RC).
- elliprd: Degenerate elliptic integral of the third kind (RD).
§Testing
The function results are compared with Boost Math test data and Wolfram Engine test data. The accuracy report and the test data along with the test generation scripts can be found here.
§Acknowledgment
Ellip is derived from multiple mathematic libraries. We thank the opensource contributors for making mathematic libraries free for all. Following are the main original works used in the development of Ellip. Detailed credits are available in the source code.
References for original implementations are:
- NIST Digital Library, Chapter 19: Elliptic Integrals (Carlson, 2024).
- Numerical calculation of elliptic integrals and elliptic functions I (Bulirsch, 1965), II (Bulirsch, 1965), and III (Bulirsch, 1969).
Unicode-style mathematical notation are created using Diagon.
Re-exports§
pub use legendre::ellipd;
pub use legendre::ellipe;
pub use legendre::ellipk;
pub use legendre::ellippi;
pub use legendre::ellipdinc;
pub use legendre::ellipeinc;
pub use legendre::ellipf;
pub use legendre::ellippiinc;
pub use bulirsch::cel;
pub use bulirsch::cel1;
pub use bulirsch::cel2;
pub use bulirsch::el1;
pub use bulirsch::el2;
pub use bulirsch::el3;
pub use carlson::elliprc;
pub use carlson::elliprd;
pub use carlson::elliprf;
pub use carlson::elliprg;
pub use carlson::elliprj;
Modules§
- bulirsch
- Elliptic integral functions in Bulirsch’s form.
- carlson
- Elliptic integral functions in Carlson’s form.
- legendre
- Elliptic integral functions in Legendre’s form.
- util
- Utility functions like assert_close.
Type Aliases§
- StrErr
- Static error str