%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CALCULA LA ÓRBITA EN EL SISTEMA SOLAR
% RESOLVIENDO LA EDO A PARTIR DEL PERIHELIO
% Y AFELIO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% DATOS 
% (unidades en el sistema internacional)
% Mercurio(1), Venus(2), Tierra(3), Marte(4)
% Ceres(5), Júpiter(6), Halley(7) 
%
% SELECCIONA LOS QUE QUIERAS DIBUJAR
ind = [1,2,4];


p = 1e10*[4.6001, 10.748, 14.710, 20.67, 38.262, 74.057, 8.7664];
a = 1e10*[6.9817, 10.894, 15.193, 24.92, 44.541, 81.652, 525.09];



for k=1:size(ind,2)
	peri = p(ind(k));
	afel = a(ind(k));

	[t,y] = gravi_edo(peri,afel);

	figure(1)
	plot(y(:,1).*cos(y(:,3)), y(:,1).*sin(y(:,3)),'LineWidth',2)
%	disp(size(t))
	axis equal

	hold on
end

% Dibuja el Sol
r = 0.5*p(1);
[X,Y] = pol2cart(r*linspace(0,2*pi,100),r*ones(1,100));
h=fill(X,Y,'r');
axis equal;

hold off