function twobody2
tspan = [0;10];
y0 = [6;0;0;0;2;0;0;.2];

options = odeset('RelTol',1e-6,'AbsTol',1e-6);
%options = [];
[t,y] = ode45(@f,tspan,y0,options);

plot(y(:,1),y(:,3),'.-g',y(:,5),y(:,7),'.-b');
% ----------------------------------------------
function ydot = f(t,y)
%G = 6.673E-11;
%M = 2.0E30;
m1 = 100;
m2 = 2;
g = -((y(1)-y(5))^2 + (y(3)-y(7))^2)^-1.5;
ydot = [y(2);m2*g*(y(1)-y(5));y(4);m2*g*(y(3)-y(7));y(6);-m1*g*(y(1)-y(5));y(8);-m1*g*(y(3)-y(7))];


