qtty
StableStrongly typed physical quantities with compile-time dimensional analysis.
3 stars
0 forks
Rust
AGPL-3.0
Updated 1 weeks ago
Why it exists
qtty provides dimensional quantities (Length, Angle, Mass, Time, Velocity, etc.) with operator overloading and compile-time unit checking. Powers Siderust's physical computations.
Key Features
- Compile-time dimensional analysis
- Zero-cost abstractions
- SI and astronomical units
- No-std compatible
Getting Started
# Add to your Cargo.toml
[dependencies]
qtty = "0.1"
# Use physical quantities
use qtty::{AU, KM, DAY};
let distance = 1.523 * AU; // Mars semi-major axis
let period = 686.97 * DAY;
let speed = distance / period; // Compiler validates dimensions Contributing
We welcome contributions! Here's how you can help:
- 1 Fork the repository and create your branch from
main - 2 Make your changes and add tests if applicable
- 3 Ensure all tests pass with
cargo test - 4 Submit a pull request with a clear description
License
This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.
Quick Links
Tags
units physics dimensional-analysis astronomy rust