主题:MATLAB 圆 球面
关于二维和三维曲面画图,可能我近日总结的一个小程序对大家有些帮助,
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% cirque sphere
% Made by Lee Guangcheng
% 2009-06-11
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear all;
%%%%%%%%%%%%%%%% cirque %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x=r*sin(theta)
% y=r*cos(theta)
figure(1)
ezplot('4*sin(theta)','4*cos(theta)',[0,2*pi])
%%%%%%%%%%%%%%% sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x=r*sin(fai)*cos(theta)
% y=r*sin(fai)*sin(theta)
% z=r*cos(fai)
figure(2)
ezsurf('4*sin(fai)*cos(theta)','4*sin(fai)*sin(theta)','4*cos(fai)',[0,pi,0,2*pi])
axis equal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% cirque sphere
% Made by Lee Guangcheng
% 2009-06-11
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear all;
%%%%%%%%%%%%%%%% cirque %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x=r*sin(theta)
% y=r*cos(theta)
figure(1)
ezplot('4*sin(theta)','4*cos(theta)',[0,2*pi])
%%%%%%%%%%%%%%% sphere %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% x=r*sin(fai)*cos(theta)
% y=r*sin(fai)*sin(theta)
% z=r*cos(fai)
figure(2)
ezsurf('4*sin(fai)*cos(theta)','4*sin(fai)*sin(theta)','4*cos(fai)',[0,pi,0,2*pi])
axis equal