function [Ax,Ay,Az]=GravityAcc(M1,X1,Y1,Z1,X2,Y2,Z2)
%We are calculating the acceleration for object 2
G=6.67408*1e-11;
R=?
Am=G*M1/(R^2);
Ax=(X1-X2)/R*Am;
Ay=(Y1-Y2)/R*Am;
Az=(Z1-Z2)/R*Am;
end
What is R in this gravitational acceleration code?
Here ,
Am=G*M1/{R^2}
Am is gravitational acceleration .
According to Newton law of Universal Gravitation states that
F=G*M1*M/{R^2}
Force = Mass*Acceleration
Hence ,
Acceleration = G*M1/{R^2}
Am= G*M1/{R^2}
R is basically the distance between the two objects according to the Newton Law .
Hence , in above relation it is clear that R is distance .
However from other equations it can be seen:
putting value of Am we can find the r to be relative distance function
Get Answers For Free
Most questions answered within 1 hours.