Skip to main content

total_kinetic_energy

Function total_kinetic_energy 

pub fn total_kinetic_energy(
    mass: f64,
    linear_velocity: f64,
    moment_of_inertia: f64,
    angular_velocity: f64,
) -> Option<f64>
Expand description

Computes total kinetic energy using KE_total = 0.5mv² + 0.5Iω².

§Examples

use use_rigidbody::total_kinetic_energy;

assert_eq!(total_kinetic_energy(2.0, 3.0, 4.0, 5.0), Some(59.0));