[ANN] MathCore 0.3.1 - Symbolic math library for Rust (like SymPy but for Rust!)
Hey Rustaceans! 👋
I'm excited to share MathCore, a symbolic mathematics library that brings computer algebra system capabilities to Rust.
## What it does
- **Symbolic math**: Parse and manipulate expressions like "x^2 + 2*x + 1"
- **Calculus**: Differentiate and integrate symbolically
- **Equation solving**: From simple linear to complex polynomial equations
- **Differential equations**: Solve ODEs and PDEs
- **Matrix operations**: Powered by nalgebra
- **Arbitrary precision**: BigInt/BigRational for exact arithmetic
- **And more**: FFT, complex numbers, numerical methods
## Quick example
use mathcore::MathCore;
fn main() {
let math = MathCore::new();
// Symbolic differentiation
let derivative = MathCore::differentiate("sin(x^2)", "x").unwrap();
println!("{}", derivative); // 2*x*cos(x^2)
// Solve equations
let roots = MathCore::solve("x^2 - 5*x + 6", "x").unwrap();
// roots: [2, 3]
// Evaluate with variables
let result = math.calculate("2*pi*r", &[("r", 5.0)]).unwrap();
// result: 31.415...
}
Why another math library?
I needed symbolic math in Rust for a physics simulation project. While there are great numerical libraries (like nalgebra), I couldn't find a comprehensive CAS for Rust.
MathCore fills that gap.
Links
- Crates.io: https://crates.io/crates/mathcore
- GitHub: https://github.com/Nonanti/mathcore
- Docs: https://docs.rs/mathcore
Would love to hear your feedback and use cases! PRs welcome 🦀