Skip to main content

impulse

Function impulse 

Source
pub fn impulse(force: f64, time: f64) -> Option<f64>
Expand description

Computes impulse from force and elapsed time using J = F * Δt.

Returns None when time is negative, when either input is not finite, or when the computed impulse is not finite.

§Examples

use use_momentum::impulse;

assert_eq!(impulse(10.0, 2.0), Some(20.0));
assert_eq!(impulse(-10.0, 2.0), Some(-20.0));