function h = magL(x,y,r,elx,ely,schop,echop)
if elx == 0
    elx = 0.4;
end
if ely == 0
    ely = 1.4;
end
if schop == 100
    schop = -1/3;
    echop = 4/3;
end
if schop == 200
    schop = -4/3;
    echop = 1/3;
end
dc= echop-schop;
fprintf('inside')
hold on
th = schop*pi:dc*pi/100:echop*pi;
xunit = elx*r * cos(th) + x;
yunit = ely*r * sin(th) + y;
fprintf('units')
%h = plot(xunit, yunit,'g*');
%plot(xunit,yunit,'g*');
h = struct('xu',xunit,'yu',yunit);
fprintf('h made')
hold off