function[ikstararr]=ikstar(dx,dy,kxdx,kydy,spmeth)

%spmeth=0   second order upwind
if spmeth==0
ikstararr=zeros(1,4);
%Forward Differencing on x 
ikstararr(1)=(-3+4*exp(i*kxdx)-exp(2*i*kxdx))/(2*dx);

%Backward Differencing on x
ikstararr(2)=(3-4*exp(-i*kxdx)+exp(-2*i*kxdx))/(2*dx);

%Forward Differencing on y
ikstararr(3)=(-3+4*exp(i*kydy)-exp(2*i*kydy))/(2*dy);

%Backward Differencing on y
ikstararr(4)=(3-4*exp(-i*kydy)+exp(-2*i*kydy))/(2*dy);

end

%spmeth=1   compact method
if spmeth==1

ikstararr=zeros(1,2);
%kx
ikstararr(1)=(3*i*sin(kxdx))/(dx*(2+cos(kxdx)));

%ky
ikstararr(2)=(3*i*sin(kydy))/(dy*(2+cos(kydy)));

end
