Skip to main content

net_force_2d

Function net_force_2d 

Source
pub fn net_force_2d(forces: &[(f64, f64)]) -> Option<(f64, f64)>
Expand description

Computes the net force from a list of planar force components.

Each tuple is interpreted as (force_x, force_y).

ยงExamples

use use_statics::net_force_2d;

assert_eq!(net_force_2d(&[(3.0, 4.0), (-1.0, 2.0)]), Some((2.0, 6.0)));