Expand description
§use-torque
Torque-specific scalar helpers for RustUse.
§Install
[dependencies]
use-torque = "0.0.1"§Foundation
use-torque provides small scalar helpers for torque, lever-arm calculations, perpendicular force components, rotational equilibrium, angular acceleration from torque, and a few basic moment-of-inertia formulas.
Inputs are expected to be SI-style numeric values:
- newtons for force
- meters for lever arm and radius
- newton-meters for torque
- radians for angle helpers unless the function name says degrees
- kilograms for mass
- kilogram square meters for moment of inertia
- radians per second squared for angular acceleration
The crate does not define a full unit system. Vector operations should live in or compose with use-vector, and broader rotational motion should live in a separate use-rotation crate.
§Example
use use_torque::{is_rotational_equilibrium, torque, torque_at_angle_degrees};
let angled_torque = torque_at_angle_degrees(10.0, 2.0, 30.0).unwrap();
assert_eq!(torque(10.0, 2.0), Some(20.0));
assert!((angled_torque - 10.0).abs() < 1.0e-12);
assert_eq!(is_rotational_equilibrium(&[10.0, -10.0], 1.0e-6), Some(true));§When to use directly
Choose use-torque when you only need reusable torque formulas and simple rotational balance helpers.
§Scope
- APIs stay dependency-free and
f64-first. - The crate does not define a full unit system.
- Vector math belongs in or alongside
use-vector. - Broader rotational motion, angular momentum, and rotational kinetic energy belong in a separate
use-rotationcrate.
§Status
use-torque is a pre-1.0 crate with a deliberately small API.
Torque-specific scalar helpers.
Modules§
- prelude
- Re-exports for ergonomic glob imports.
Structs§
- Lever
Force - A force applied at a lever arm.
- Torque
System - A collection of torque values that can be analyzed as a system.
Functions§
- angular_
acceleration_ from_ torque - Computes angular acceleration from torque and moment of inertia.
- balancing_
force - Computes the balancing force needed at a lever arm to cancel a known torque.
- balancing_
lever_ arm - Computes the balancing lever arm needed for a force to cancel a known torque.
- force_
from_ torque - Computes the force required to produce a known torque at a lever arm.
- is_
rotational_ equilibrium - Checks whether a torque system is in rotational equilibrium.
- lever_
arm_ from_ torque - Computes the lever arm required to produce a known torque from a force.
- moment_
arm - Computes the perpendicular moment arm from a lever arm and angle in radians.
- moment_
arm_ degrees - Computes the perpendicular moment arm from an angle given in degrees.
- net_
torque - Computes the sum of a slice of torque values.
- net_
torque_ from_ force_ lever_ pairs - Computes the net torque for force and lever-arm pairs.
- perpendicular_
force_ component - Computes the component of a force that acts perpendicular to a lever arm.
- perpendicular_
force_ component_ degrees - Computes the perpendicular force component from an angle given in degrees.
- point_
mass_ moment_ of_ inertia - Computes the moment of inertia for a point mass.
- rod_
moment_ of_ inertia_ about_ center - Computes the moment of inertia of a uniform rod about its center.
- rod_
moment_ of_ inertia_ about_ end - Computes the moment of inertia of a uniform rod about one end.
- torque
- Computes torque from a force and lever arm.
- torque_
at_ angle - Computes torque when the applied force meets the lever arm at an angle in radians.
- torque_
at_ angle_ degrees - Computes torque when the applied force meets the lever arm at an angle in degrees.
- torques_
from_ force_ lever_ pairs - Converts force and lever-arm pairs into torque values.