/**************************************************************************** Function Name: fAccel Description: This function calculates the acceleration of a particle at a certain distance and returns that values to integration routine returns:double Input:double,double ************************************************************************/ #include #include #include /*define force softening*/ #define EPS 0 double fAccel(double* r,double m,double* radius2,int dim) { /*define the variables radius from the center of mass of the particle` *the particle this is for the particle whose acceleration is being determined denoted by dRadius, the radius of the other particle wrt which the acceleration is being calculated dOtherParticle, the mass of the other particle dMass. This code will be run in a loop so all it will additively spit out the acceleration due to gravity */ double* dRadius; dRadius=r; double dDistMag; double dMass=m; double dGrav; double* dOtherParticle; dOtherParticle=radius2; int iDimensions=dim; int i; for(i=0;i