%**************************************************************************
%This function calculates the slippage distance between the light and the
%electrons in an undulator.
%
%Input:
%z, position along the undulator (m)
%vz, velocity in the z direction (m)
%
%Output:
%slip, the distance between the light and the electrons at z (m)
%
%Zachary Wolf, 5/19/10

%Calculations:
%Slippage, distance between electrons and light:
%d_slip = (c - vz) d_t
%d_slip = (c - vz) (dz / vz)
%d_slip = ((c / vz) - 1) dz
%slip = int ((c / vz) - 1) dz
%slip(z = 0) = 0

function slip = slip_calc_slip_vz(z, vz)

%Global constants
global C_LIGHT;

%Calculate the slippage
c = C_LIGHT * ones(1, length(z));
slip = int_calc_int_y_dx(z, (c ./ vz) - 1);

%Done
