Skip to main content

torque_at_angle

Function torque_at_angle 

Source
pub fn torque_at_angle(
    force: f64,
    lever_arm: f64,
    angle_radians: f64,
) -> Option<f64>
Expand description

Computes torque when the applied force meets the lever arm at an angle in radians.

Formula: τ = r * F * sin(theta)

Returns None when any input is not finite or when the computed result is not finite. Negative forces and lever arms are allowed.

§Examples

use core::f64::consts::FRAC_PI_2;
use use_torque::torque_at_angle;

let applied = torque_at_angle(10.0, 2.0, FRAC_PI_2).unwrap();

assert!((applied - 20.0).abs() < 1.0e-12);