Skip to main content

Crate use_torque

Crate use_torque 

Source
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-rotation crate.

§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§

LeverForce
A force applied at a lever arm.
TorqueSystem
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.