function  ob = fsphere(ra,x0,y0,z0,tp)
% function  ob = fsphere(ra,x0,y0,z0,tp)
% ra = rayon
% x0 = position en x
% y0 = position en y
% z0 = position en z
% tp = type (1=surf;2=surfl)

[ph,th]=meshgrid(-pi/2:pi/25:pi/2,0:pi/25:2*pi);
x=ra*cos(ph).*cos(th);
y=ra*cos(ph).*sin(th);
z=ra*sin(ph);

switch tp
case 1
   ob=surf(x+x0,y+y0,z+z0);
case 2
   ob=surfl(x+x0,y+y0,z+z0);
end

%© by Cédric Blaser / 27.11.2001