一个球一个圆,不知道你想表达什么
画球
interval=2*pi/360;;
t=-pi:interval:pi;
t2=(-pi:interval:pi)';
x=cos(t2/2)*sin(t);
y=cos(t2/2)*cos(t);
z=sin(t2/2)*ones(size(t));
figure,hold on;
surf(x,y,z);
grid on;
alpha(0.2);
shading flat;
view([1,1,0.5])
[x1,y1,z1]=sphere(400);
xq=2*x1;yq=2*y1;zq=z1*2;
mesh(xq,yq,zq) %画球
alpha(0.9);
hold on
[x,y,z]=cylinder(2,400);
mesh(x,y,z),%画圆柱
alpha(0.2);
colormap(jet)
plot3(x(1,:),y(1,:),zeros(length(x(1,:))),'k.')%画交线
hold off
按上面语句试试