pub struct QuadTree { /* private fields */ }Implementations§
Source§impl QuadTree
impl QuadTree
pub fn build(pos: &[[f32; 2]]) -> Self
Sourcepub fn repulsion(
&self,
i: usize,
pos: &[[f32; 2]],
theta: f32,
strength: f32,
) -> [f32; 2]
pub fn repulsion( &self, i: usize, pos: &[[f32; 2]], theta: f32, strength: f32, ) -> [f32; 2]
Force on body i. Negative strength repels (d3’s convention).
The contribution of body b is strength * (b - i) / d², so a negative
strength points the force away from b. The magnitude falls off as
1/d, not 1/d²: that is d3’s law, and it is what makes the Barnes-Hut
monopole approximation accurate enough to run at theta = 0.9.
Auto Trait Implementations§
impl Freeze for QuadTree
impl RefUnwindSafe for QuadTree
impl Send for QuadTree
impl Sync for QuadTree
impl Unpin for QuadTree
impl UnsafeUnpin for QuadTree
impl UnwindSafe for QuadTree
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