function [B]=flatsheet_B(r,d,y0,j,stepanz)
%**************************************************************************
% CLUSTER project: Cluster Flight                  Autor: Christian Maszl * 
% Unit System = [SI]                  Mail: e0025754@student.tuwien.ac.at *
%**************************************************************************
%
% This subroutine calculate the B field vectors for every
% position. The infinite current sheet with thickness of 2d  
% lay in the y/z-plane. The current vector point in the positive
% y-direction.

B=zeros(10*stepanz,3);
% Convert B to nT
for i=1:(10*stepanz)+1
    if (abs(r(i,1))<=d)
       B(i,3)=-y0*j*r(i,1)*1e9;
    elseif (r(i,1)>d)
       B(i,3)=-y0*j*d*1e9;
    elseif (r(i,1)<d)
       B(i,3)=+y0*j*d*1e9;
    end
end




