# This GiNaC script (http://www.ginac.de) was used to generate C code # which was then adapted into the IDL function oblate_spheroid_acceleration.pro. # It differentiates the function found in oblate_spheroid_potential.pro. #g=6.67384e-11; #const=g*dpi*rho*a*a*c; terma1=1-(x*x+y*y-2*z*z)/(2*(a*a-c*c)); terma2=(2*asin(sqrt((a*a-c*c)/(a*a))))/sqrt(a*a-c*c); terma=terma1*terma2; termb1=(c/(a*a-c*c))*((x*x+y*y)/(a*a)); termb=termb1; termc1=2*z*z/c; termc2=a*a-c*c; termc=-1.*termc1/termc2; u=-1.*const*(terma+termb+termc); 0; 0; print_csrc(diff(u,x)); 0; 0; print_csrc(diff(u,y)); 0; 0; print_csrc(diff(u,z));