matlab画圆
程序员文章站
2022-03-10 12:08:30
...
代码
[m,n,k]=sphere(30);
k(k<0)=nan;
surf(9*m,9*n,9*k)%画圆
alpha(.2)%透明度
shading interp %阴影
hold on
%画线
for i = 1:7
o(i) = 9* cos(22*pi/180)*cos(360/6*i*pi/180);
p(i) = 9*cos(22*pi/180)*sin(360/6*i*pi/180);
q(i) = 9*sin(22*pi/180);
end
%三维画图
plot3(o,p,q);