code of a circle then by changing the z as the circle height and changing the r as its radius i can create a cone( at least something like it ).

VB

r=1 teta=-pi:0.01:pi x=r*cos(teta); y=r*sin(teta); z=zeros(1,numel(x)); plot3(x,y,z); hold on % ----------------------------------- % for i = 1 : 20 z=z+0.05; r=r-0.05; x=r*cos(teta); y=r*sin(teta); plot3(x,y,z); hold on end hold off

Thank you.

you can read the comments under the previous question you may get something.

well the cone is solved and for creating a sphere using same formula i need to give the circle a little slope instead of giving it height( means the same center(x,y,z) but different angle )