function HorizontalAngle = getHorizontalAngleDB(x_coord,y_coord)

L1x = x_coord(1,:,:);
a=find(sum(L1x)==0);
L1x(:,:,a)=[];
L1x = reshape(L1x,1,prod(size(L1x)));
ind = find(L1x==0);
L1x(ind) = [];
L1x = mean(L1x);

L1y = y_coord(1,:,:);
b=find(sum(L1y)==0);
L1y(:,:,b)=[];
L1y = reshape(L1y,1,prod(size(L1y)));
ind = find(L1y==0);
L1y(ind) = [];
L1y = mean(L1y);

S1x = x_coord(6,:,:);
c=find(sum(S1x)==0);
S1x(:,:,c)=[];
S1x = reshape(S1x,1,prod(size(S1x)));
ind = find(S1x==0);
S1x(ind) = [];
S1x = mean(S1x);

S1y = y_coord(6,:,:);
d=find(sum(S1y)==0);
S1y(:,:,d)=[];
S1y = reshape(S1y,1,prod(size(S1y)));
ind = find(S1y==0);
S1y(ind) = [];
S1y = mean(S1y);

line = polyfit([L1x S1x],[L1y S1y],1);
HorizontalAngle = abs(atan(line(1))*180/pi);
