t=0:0.05:10;a=-20/180*pi+2*t;b=-50/180*pi+4*t;r=50;x=r*cos(a).*cos(b);y=r*cos(a).*sin(b);z=r*sin(a);plot3(x,y,z)
搜一下:matlab中球坐标和直角坐标系的转化,要求轨迹图(matlab编程)