function [g,xg]=lorentz(Xo,fwhm,x,Yo)
%  [g,xg]=lorentz(Xo,fwhm,x,Yo)
%
% lorentzian profile
%
% <in>
%  Xo -center pos
%  fwhm  full width half maximum
%  x  x-value (can be scalar or 1d-vector)
%  Yo  maximum intensity, call lorentz without  Yo to get
%       area=1 profile
%  <out>
%   g   Lorentz-data
%   xg  x-data back
%

%
%  FG 14.5.07   
% 
Z=2.*(x-Xo)/fwhm;
if nargin > 3 
      g=Yo./(1.0+Z.*Z);
else
      YV=.636619772/fwhm;
      g=YV./(1.0+Z.*Z);
end
xg=x;