bima-rs 0.2.0

N-body simulation
Documentation
1
2
3
4
5
6
7
use crate::{integrator::Solution, vec6::Vec6};

pub fn solve<F: FnMut(Vec6, bool) -> Vec6>(w: Vec6, dt: f64, mut wdot_func: F) -> Solution {
    let wdot = wdot_func(w, true);
    let w = w + wdot * dt;
    Solution::new(w, Some(wdot.v))
}