Expand description
§use-statics
Small statics helpers for RustUse.
§Install
[dependencies]
use-statics = "0.0.1"§Foundation
use-statics provides small helpers for force balance, moment balance, equilibrium checks,
static friction, inclined planes, and simple support reactions.
Inputs are expected to be SI-style numeric values:
- newtons for force and load
- meters for span, position, and moment arm
- newton-meters for moment
- kilograms for mass
- radians for incline angle
- newtons per meter for distributed load
The crate stays narrow on purpose. It is not a structural analysis engine, finite element solver, truss solver, frame solver, rigid-body physics engine, or simulation framework.
Vector operations should live in or compose with use-vector. Torque-specific helpers belong in
use-torque. Rigid-body mechanics belong in use-rigidbody. Simulation belongs in top-level
use-simulation.
§Example
use use_statics::{
CantileverReaction, Force2D, StaticSystem2D, cantilever_end_point_load_reaction,
simply_supported_point_load_reactions,
};
let Some(system) = StaticSystem2D::new(
vec![
Force2D::new(100.0, 0.0).unwrap(),
Force2D::new(-100.0, 0.0).unwrap(),
],
vec![0.0],
) else {
panic!("valid system should construct");
};
let Some((left, right)) = simply_supported_point_load_reactions(10.0, 100.0, 5.0) else {
panic!("valid point load should produce reactions");
};
let Some(cantilever) = cantilever_end_point_load_reaction(2.0, 50.0) else {
panic!("valid cantilever load should produce a reaction");
};
assert_eq!(system.is_equilibrium(0.0), Some(true));
assert_eq!((left, right), (50.0, 50.0));
assert_eq!(
cantilever,
CantileverReaction {
vertical_reaction: 50.0,
fixed_end_moment: 100.0,
}
);§When to use directly
Choose use-statics when you want small, direct helpers for introductory or utility-level statics
work without pulling in a broader mechanics surface.
§Scope
- APIs stay dependency-free and
f64-first. - Helpers focus on scalar formulas and simple 2D force and moment balances.
- Arbitrary beam loading, truss analysis, frame analysis, FEA, CAD, and design-code compliance are out of scope.
- Broad vector algebra belongs in
use-vectoror companion math crates.
§Status
use-statics is a pre-1.0 crate with a deliberately small API.
Small statics helpers.
Modules§
- prelude
- Re-exports for ergonomic glob imports.
Structs§
- Cantilever
Reaction - Fixed-end reaction data for a cantilever with a free-end point load.
- Force2D
- A validated planar force value.
- Point
Force2D - A planar force applied at a position relative to a chosen moment point.
- Static
System2D - A simple planar static system made of force vectors and scalar moments.
Functions§
- can_
static_ friction_ hold - Checks whether static friction can hold a body at rest.
- cantilever_
end_ point_ load_ reaction - Computes the fixed-end reaction for a cantilever with a downward load at the free end.
- downslope_
force_ incline - Computes the downslope component of weight on an incline.
- force_
angle_ radians - Computes the planar angle of a force vector in radians.
- force_
magnitude - Computes the magnitude of a planar force vector.
- is_
rotational_ equilibrium - Checks whether a moment system is in rotational equilibrium.
- is_
static_ equilibrium_ 2d - Checks whether a planar static system satisfies both translational and rotational equilibrium.
- is_
translational_ equilibrium_ 1d - Checks whether a 1D force system is in translational equilibrium.
- is_
translational_ equilibrium_ 2d - Checks whether a 2D force system is in translational equilibrium.
- maximum_
static_ friction - Computes the maximum available static friction.
- minimum_
static_ friction_ coefficient_ for_ incline - Computes the minimum static friction coefficient needed to prevent sliding on an incline.
- moment_
2d - Computes the scalar
z-moment of a planar force about a chosen point. - moment_
from_ force_ and_ arm - Computes a moment from a signed force and a signed moment arm.
- net_
force_ 1d - Computes the net force from a list of scalar forces.
- net_
force_ 2d - Computes the net force from a list of planar force components.
- net_
moment - Computes the net moment from a slice of scalar moment values.
- net_
moment_ 2d - Computes the net moment from planar point forces.
- normal_
force_ horizontal_ surface - Computes the normal force on a horizontal surface.
- normal_
force_ incline - Computes the normal force on an incline.
- required_
static_ friction - Computes the static friction magnitude required to hold horizontal equilibrium.
- simply_
supported_ point_ load_ reactions - Computes support reactions for a simply supported beam with one point load.
- simply_
supported_ uniform_ load_ reactions - Computes support reactions for a simply supported beam with a uniform load.