Function work_at_angle_degrees
Source pub fn work_at_angle_degrees(
force: f64,
displacement: f64,
angle_degrees: f64,
) -> Option<f64>
Expand description
Computes mechanical work when the applied-force angle is given in degrees.
This function converts angle_degrees to radians internally and then delegates to
work_at_angle.
5fn main() {
6 assert_eq!(work(10.0, 2.0), Some(20.0));
7 assert_eq!(
8 ConstantForceWork::new(10.0, 2.0).and_then(|constant| constant.work()),
9 Some(20.0)
10 );
11 assert!(matches!(
12 work_at_angle_degrees(10.0, 2.0, 60.0),
13 Some(value) if (value - 10.0).abs() < 1e-12
14 ));
15}