Skip to main content

ForceField

Trait ForceField 

Source
pub trait ForceField {
    // Required methods
    fn acceleration(&self, position: &Vec3, mass: f64) -> Vec3;
    fn potential(&self, position: &Vec3, mass: f64) -> f64;
}
Expand description

Force field trait for computing accelerations.

Required Methods§

Source

fn acceleration(&self, position: &Vec3, mass: f64) -> Vec3

Compute acceleration for a body at given position.

Source

fn potential(&self, position: &Vec3, mass: f64) -> f64

Compute potential energy at given position.

Implementors§