You are on page 1of 1

function [ Xe Ye Ze] = esfera(R,N )

%
th=linspace(-pi,pi,N);
ph=linspace(0,pi,N/2);
[Th Ph]=meshgrid(th,ph);
Xe=R*sin(Ph).*cos(Th);
Ye=R*sin(Ph).*sin(Th);
Ze=R*cos(Ph);
surf(Xe,Ye,Ze)
end

You might also like