use-relativity
Small special relativity scalar helpers for RustUse.
Install
[]
= "0.0.1"
Foundation
use-relativity provides small special relativity scalar helpers for Lorentz factor, time dilation,
length contraction, mass-energy relations, relativistic momentum, rapidity, velocity addition,
and simple longitudinal Doppler calculations.
Inputs are expected to be SI-style numeric values:
- meters per second for speed and velocity
- seconds for time
- meters for length
- kilograms for mass
- joules for energy
- kilogram meters per second for momentum
- hertz for frequency
Positive beta in the Doppler helpers means the source is approaching the observer.
This crate keeps SPEED_OF_LIGHT locally for convenience. Broader physical constants belong in the
top-level use-constants set.
Unit abstractions belong in the top-level use-units set.
Example
use ;
assert_eq!;
assert!;
assert!;
let body = new.unwrap;
assert!;
When to use directly
Choose use-relativity when you need small scalar special relativity helpers without a full unit,
geometry, or simulation system.
Scope
- APIs stay
f64-first and focus on scalar special relativity helpers. - General relativity, tensor calculus, curved spacetime, and numerical simulation are out of scope.
- Full constants systems and unit abstractions belong in
use-constantsanduse-units.
Status
use-relativity is a pre-1.0 crate with a deliberately small API.