Code covered by the BSD License  

Highlights from
Gravity

image thumbnail
from Gravity by link2358 noname
Computes position of several bodies under the action of gravitatory forces.

recpos(t,deltat,pos2)
function [position] = recpos(t,deltat,pos2)

lt = floor(t/deltat);
alpha = (t-lt*deltat)/deltat;
position = pos2(:,:,lt)*(1-alpha)+pos2(:,:,lt+1)*alpha;

Contact us at files@mathworks.com