typedef struct { char name[20]; double mass; double x_pos,y_pos,z_pos; double x_vel,y_vel,z_vel; } ObjectT; /* ** Gravity_Proc : The Intergalactic Warping Calculating Routine ** for FAST calculating of gravitational motions ** ** USAGE:-ObjectT object[] = array of type ObjectT, it contains ** the necassary information for the calculations: ** ** typedef struct ** { ** char naam[20]; <- not used in the routine ** double mass; ** double x_pos,y_pos,z_pos; ** double x_vel,y_vel,z_vel; ** } ObjectT; ** ** -int objects = the funtion needs to know how much objects ** there are in the system. ** ** -double G = The gravity-constant = 6.67e-11 ** ** -double dT = The 'infinitisemale' time-interval ** ** -int iterations = the number of iterations to be done ** previously always 1, but this routine is ** really FAST, so I warned you. */ void Gravity_Proc(ObjectT object[], int objects, double G, double dT, int iterations) { /* ObjectT type ** { ** char naam[20]; ** double mass; ** double x_pos,y_pos,z_pos; ** double x_vel,y_vel,z_vel; ** } */ int i; int first,second; double r2,r; double f,fx,fy,fz; double dvxm,dvym,dvzm; for (i=0; i