If you are talking of 3dGS physics system, maybe this:

Code:
 
//while(1)
var sphere_pos[3];
var grav_vec[3];

vec_set(sphere_pos,sphere.x);
vec_diff(grav_vec, sphere_pos.x, my.x);
vec_normalize(grav_vec,grav_force);
phent_addcentralforce ( my, grav_vec );