clear all;
clf;
C = 1.0;
m = 1.0;
time = 30.0;
dt = 0.001;
vr0y = [0.1 0.5 1.0 5.0 10.0];
for r0y = vr0y
    v0 = [1.0 0.0];
    r0 = [-15.0 r0y];
    n = ceil(time/dt);
    r = zeros(n,2);
    v = zeros(n,2);
    t = zeros(n,1);
    r(1,:) = r0;
    v(1,:) = v0;
    for i = 1:n-1
        rr3 = norm(r(i,:))^3;
        F = C*r(i,:)/rr3;
        a = F/m;
        v(i+1,:) = v(i,:) + a*dt;
        r(i+1,:) = r(i,:) + v(i+1,:)*dt;
        t(i+1) = t(i) + dt;
    end
    plot(r(:,1),r(:,2))
    hold on
end
xlabel('x')
ylabel('y')
hold off
