%**************************************************************************
%This function calculates the required horizontal motion of the undulator
%in order to get the desired gap change.
%
%Input:
%cant_angle, angle the poles make with respect to each other (positive)
%k_shim_dgap, gap change required to get the desired K value (m)
%
%Output:
%k_shim_dxbeam, horiztal motion of the beam requred to get the desired K value (m)
%
%Zachary Wolf, 1/14/06

function [k_shim_dxbeam] = k_shim_calc_dx(cant_angle, k_shim_dgap)

%Method
%The poles open out toward negative x.  Beam motion toward positive x means
%the beam is in a higher field and the K value is higher.

%Perform the calculation
k_shim_dxbeam = - k_shim_dgap / cant_angle;
    
%Done
