function [ results ] = plot_orbit( x0, y0, xp0, yp0, gamma, Bmap1D, alpha )
%plot_orbit given an input trajectory, what's the output?
%   x0, y0 is initial transverse position
%   gamma0 is beam's lorentz factor
%   Bmap1D is the fieldmap data
%   alpha is the field rolloff fraction at 1 mm: alpha = 1 - B(x=1mm) / B(x=0)
%   outray is list of [z, x, y, xp, yp] at output position z

c = 2.998e8; % speed of light (m/s)

results = trajectory( x0, y0, xp0, yp0, gamma, Bmap1D, alpha );

figure;set(gcf,'color','w');
c1 = [0., 0.4470, 0.7410];
c2 = [0.8500, 0.3250, 0.0980];
plot(results(:,3), 1e3*results(:,1), 'color', c1);
hold on;
plot(results(:,3), 1e3*results(:,2), 'color', c2);
xlabel('z position (m)');
ylabel('Transverse position (mm)');
title('2D trajectory');
legend('x','y','location','best');
enhance_plot('arial',20,2,8)

end

