a guest Jan 14th, 2020 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //include math.h to get the sqrt command
- #include <math.h>
- //ax and ay should be stored from the previous loop.
- //Calculate the vector acceleration. First find 1/distance cubed
- double dist=sqrt(x*x+y*y);
- //Do another half timestep like in leapint.c
RAW Paste Data