Skip to main content

near_surface_potential_energy

Function near_surface_potential_energy 

Source
pub fn near_surface_potential_energy(
    mass: f64,
    height: f64,
    gravitational_acceleration: f64,
) -> Option<f64>
Expand description

Computes near-surface potential energy from mass, height, and gravitational acceleration.

Formula: U = m * g * h

Returns None when mass is negative, when gravitational_acceleration is not finite, or when the computed result is not finite. Negative heights are allowed.