Magba is a performant analytical magnetic computation library for Rust.
Quick Start
To install, simply: cargo add magba.
Compute the B-field of a cylindrical magnet at a point:
use ;
use ;
let magnet = new;
let b = magnet.get_B.unwrap;
println!;
Features
- Analytical magnetic field computation for:
- Cylindrical magnets (axial and diametric)
- Source collections (grouping magnets)
- Transformations: Move and rotate sources in 3D space
- Parallel computation (optional, via Rayon)
- Tested against MagpyLib and reference data
- Python bindings available via Pymagba
Testing
Results are validated against MagpyLib and reference data.
See /tests/test-data and the accuracy report for details.
Documentation
Learn more at docs.rs/magba.