Skip to main content

lorentz_factor_from_beta

Function lorentz_factor_from_beta 

Source
pub fn lorentz_factor_from_beta(beta: f64) -> Option<f64>
Expand description

Computes the Lorentz factor γ = 1 / sqrt(1 - β²) from a non-negative beta magnitude.

Returns None when beta is negative, not finite, greater than or equal to 1.0, or when the computed factor is not finite.

§Examples

use use_relativity::lorentz_factor_from_beta;

assert_eq!(lorentz_factor_from_beta(0.0), Some(1.0));