function [ outray ] = output_ray( x0, y0, xp0, yp0, gamma, Bmap1D, alpha )
%OUTPUT_RAY 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 );

outray = [results(end,3), results(end,1), results(end,2), results(end,4)/c, results(end,5)/c]; 

end

