use-momentum 0.0.1

Momentum, impulse, and recoil helpers for RustUse
Documentation
  • Coverage
  • 82.35%
    14 out of 17 items documented5 out of 14 items with examples
  • Size
  • Source code size: 12.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 398.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-physics
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-momentum

Linear momentum, impulse, and recoil helpers for RustUse.

Install

[dependencies]
use-momentum = "0.0.1"

Foundation

use-momentum provides small f64-first helpers for linear momentum and impulse calculations.

Inputs are expected to be SI-style numeric values:

  • kilograms for mass
  • meters per second for velocity
  • kilogram meters per second for momentum
  • newton seconds for impulse
  • seconds for time

The crate does not define a full unit system.

Example

use use_momentum::{MovingMass, impulse, momentum, recoil_velocity};

assert_eq!(momentum(2.0, 3.0), Some(6.0));

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

assert_eq!(recoil_velocity(1.0, 10.0, 5.0), Some(-2.0));
assert_eq!(MovingMass::new(2.0, 3.0).unwrap().momentum(), Some(6.0));

When to use directly

Choose use-momentum when you need small, reusable helpers for scalar momentum, impulse, and recoil.

Scope

  • APIs stay f64-first and focus on one-dimensional scalar helpers.
  • One-dimensional collision outcomes and restitution helpers belong in use-collision.
  • Higher-dimensional vector operations should live in or compose with use-vector.
  • Full rigid-body simulation and broader physics engines are out of scope.

Status

use-momentum is a pre-1.0 crate with a deliberately small API.