pub struct NewtonForce { /* private fields */ }Expand description
A struct representing a Newton (or Coloumb-like) force, which implements the Force trait.
Trait Implementations§
Source§impl Default for NewtonForce
impl Default for NewtonForce
Source§fn default() -> Self
fn default() -> Self
The default instance of NewtonForce. The parameters are set to the following.
| Parameter | Value |
|---|---|
factor | 1.0 |
Source§impl Force for NewtonForce
impl Force for NewtonForce
Source§fn potential(&self, particle: &Particle, other: &Particle) -> f64
fn potential(&self, particle: &Particle, other: &Particle) -> f64
Calculates the potential energy between two particles according to Newton’s law of universal gravitation.
potential = -G * M / r
potential = -M / r (assuming G = 1)Source§fn system_name(&self) -> &str
fn system_name(&self) -> &str
Returns Read more
Auto Trait Implementations§
impl Freeze for NewtonForce
impl RefUnwindSafe for NewtonForce
impl Send for NewtonForce
impl Sync for NewtonForce
impl Unpin for NewtonForce
impl UnwindSafe for NewtonForce
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more