Force functions for the force simulation.
Each force modifies node velocities based on different rules.
Summary
Functions
Applies a force to the nodes.
Center force - keeps nodes centered around a point.
Collision force - prevents nodes from overlapping.
Link force - maintains distances between connected nodes.
Many-body force - simulates gravity or electrostatic charge.
Radial force - pushes nodes toward/away from a circle.
X positioning force - pushes nodes toward an x position.
Y positioning force - pushes nodes toward a y position.
Functions
Applies a force to the nodes.
Center force - keeps nodes centered around a point.
Collision force - prevents nodes from overlapping.
Link force - maintains distances between connected nodes.
Many-body force - simulates gravity or electrostatic charge.
Positive strength attracts, negative repels. Every pair is evaluated directly, O(n²) per tick; there is no Barnes-Hut approximation.
Radial force - pushes nodes toward/away from a circle.
X positioning force - pushes nodes toward an x position.
Y positioning force - pushes nodes toward a y position.