[Media] Published a paper on a Rust crate! Ellip: an elliptic integral library

201 points Inspacious 15 comments
[Media] Published a paper on a Rust crate! Ellip: an elliptic integral library

Hi everyone,

I've just published an article on JOSS (The Journal of Open Source Software), describing the crate ellip, a pure-Rust library for calculating elliptic integrals. Elliptic integrals are special mathematical functions useful for computing the lengths of curves and magnetic fields. It's applied in other physics and engineering fields as well.

I built this because I needed a solution that was dependency-free (no C binding). I thought it would be a quick project, but it ended up taking way longer than anticipated.

I worked on Ellip on and off for about a year. This is the breakdown of my time:

  • 10% - implementing the math routines,
  • 30% - writing docs,
  • 40% - writing tests, comparing the results with Wolfram, and debugging things.
  • The rest of the percentage went to struggling with Rust, as this was one of my first Rust projects.

The paper itself went pretty smoothly, which I think owed significantly to the extensive testing. Ellip was integrated into the special crate as well, and I learned a lot from contributing to it.

Example use case:

use ellip::*;
fn ellipse_length(a: f64, b: f64) -> f64 {
    8.0 * elliprg(0.0, a * a, b * b).unwrap()
}
// ellipse with semi-major axis 5, semi-minor axis 3
let ans = ellipse_length(5.0, 3.0);  // 25.526998863398124

I'd love to hear your feedback on the paper and the code. I plan to continue contributing to the community, so learning from your inputs and improving would be awesome.

---

As you may know (or guess), most of the work published in JOSS is Python. I hope that Rust will gain more traction in the research community. I may be biased, but I think Rust is one of the most logical and well-crafted languages for deeper research.