Expand description
§Ellip - Elliptic integrals for Rust
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.
Use Ellip-Rayon to parallelize and improve performance for large inputs. Ellip is also available for Python via EllipPy.
§Example
Calculating the perimeter of an ellipse.
use ellip::*;
fn ellipse_perimeter(a: f64, b: f64) -> Result<f64, StrErr> {
Ok(8.0 * elliprg(0.0, a * a, b * b)?)
}
// Example: ellipse with semi-major axis 5, semi-minor axis 3
println!("{}", ellipse_perimeter(5.0, 3.0).unwrap()); // 25.526998863398124§Features
- legendre — Legendre’s integrals
- bulirsch — Bulirsch’s integrals
- carlson — Carlson’s symmetric integrals: the first, second, and third kinds (elliprf, elliprg, elliprj), and the degenerate integrals (elliprc, elliprd)
- misc — Miscellaneous functions: jacobi_zeta and heuman_lambda
§Testing
The full accuracy report, test datasets, and test generation scripts are available in the tests directory. The test and benchmark summary is available in TESTING.md. See how to reproduce the results in REPRODUCIBILITY.md.
§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, 2025).
- Numerical calculation of elliptic integrals and elliptic functions I (Bulirsch, 1965), II (Bulirsch, 1965), and III (Bulirsch, 1969).
- NIST Digital Library, Chapter 22 Jacobian Elliptic Functions (Reinhardt and Walker, 2025).
Unicode-style mathematical notation are created using Diagon.
§Citation
The paper describing Ellip is published in the Journal of Open Source Software. If Ellip is helpful to your work, please consider citing it:
Pornsiriprasert, S., (2026). Ellip: An Elliptic Integral Library for Rust. Journal of Open Source Software, 11(118), 9386, https://doi.org/10.21105/joss.09386Bibtex format:
@article{Pornsiriprasert2026,
doi = {10.21105/joss.09386},
url = {https://doi.org/10.21105/joss.09386},
year = {2026},
publisher = {The Open Journal},
volume = {11}, number = {118}, pages = {9386},
author = {Pornsiriprasert, Sira},
title = {Ellip: An Elliptic Integral Library for Rust},
journal = {Journal of Open Source Software} }Re-exports§
pub use legendre::ellipd;pub use legendre::ellipe;pub use legendre::ellipk;pub use legendre::ellipke;pub use legendre::ellippi;pub use legendre::ellipdinc;pub use legendre::ellipeinc;pub use legendre::ellipf;pub use legendre::ellippiinc;pub use legendre::ellippiinc_bulirsch;pub use bulirsch::cel;pub use bulirsch::cel1;pub use bulirsch::cel2;pub use bulirsch::cel3;pub use bulirsch::el1;pub use bulirsch::el2;pub use bulirsch::el3;pub use bulirsch::el3;pub use carlson::elliprc;pub use carlson::elliprd;pub use carlson::elliprf;pub use carlson::elliprg;pub use carlson::elliprj;pub use misc::heuman_lambda;pub use misc::jacobi_zeta;
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.
- misc
- Functions related to elliptic integrals
- util
- Utility functions like assert_close.
Type Aliases§
- StrErr
- Static error str