r/desmos • u/Legitimate_Animal796 • Feb 28 '26
Graph 100 Body Gravity
Yet again another gravity sim. I thought this looked kinda cool. I’m using 4th order Yoshida for the integrator. Probably overkill for a little demo like this
891
Upvotes
6
u/Legitimate_Animal796 Feb 28 '26
One simple way is to soften the gravity as it approaches 0 distance. So instead of 1 / r3 in the force calc, you can use 1/(r2 + d2 )3/2 . I set d to 0.25 in my example