标签:style blog http color os ar 2014 div sp
在天文领域或者其他一些领域,经常要画一些透明的三维球,其中“透明”可以用alpha函数来设置,矢量箭头可以用quiver3函数来实现。
t=linspace(0,pi,25); p=linspace(0,2*pi,25); [theta,phi]=meshgrid(t,p); x=5*sin(theta).*sin(phi); y=5*sin(theta).*cos(phi); z=5*cos(theta); surf(x,y,z,‘linestyle‘,‘none‘); axis equal; alpha(0.1); %控制图形的透明度,取值0~1 hold on; quiver3(0,0,0,1,2,3); quiver3(0,0,0,0,2,3); quiver3(0,0,0,1,2,0);
结果预览如下:
【Matlab微代码】画一个透明的三维球体并在里面显示一个矢量箭头
标签:style blog http color os ar 2014 div sp
原文地址:http://www.cnblogs.com/wqhjzad/p/3981856.html