求单叶双曲面和双叶双曲面、椭圆抛物面、双曲抛物面用matlab怎么画或其参数方程?有个例子就成,选修可的实验报告.大一高数学的不太好,现在乘机补课.

问题描述:

求单叶双曲面和双叶双曲面、椭圆抛物面、双曲抛物面用matlab怎么画或其参数方程?
有个例子就成,选修可的实验报告.大一高数学的不太好,现在乘机补课.

啊啊啊啊啊啊

%%%%%%%%%圆%%%%%%%%%%%%%%
x=-1:0.00001:1;
r=1;%半径r=1
y1=sqrt(r-x.^2);
y2=-sqrt(r-x.^2);
plot(x,y1,x,y2)
%%%%%%%%%椭圆%%%%%%%%%%%%%%
x=-1:0.00001:1;
a=1;b=1;%椭圆半径a=1;b=1
y1=sqrt(b.^2*(1-x.^2/(a.^2)));
y2=-sqrt(b.^2*(1-x.^2/(a.^2)));
plot(x,y1,x,y2)
%%%%%%%%%抛物线%%%%%%%%%%%%%%
x=1:0.00001:5;
a=1;b=1;%抛物半径a=1;b=1
y1=sqrt(b.^2*(x.^2/(a.^2)-1));
y2=-sqrt(b.^2*(x.^2/(a.^2)-1));
plot(x,y1,x,y2)
%%%%%%%%%椭球面%%%%%%%%%%%%%%
xa=-2:0.2:2;
ya=xa;
[x,y]=meshgrid(xa,ya);
a=1;b=1;c=1;% 假设a=1;b=1;c=1
z1=sqrt(c.^2*(1-x.^2/(a.^2)+y.^2/(b.^2)));
z2=-sqrt(c.^2*(1-x.^2/(a.^2)+y.^2/(b.^2)));
mesh(x,y,z1)
hold on;
mesh(x,y,z2)
%%%%%%%%%%%单叶双曲面%%%%%%%%%%%
xa=-2:0.2:2;
ya=xa;
[x,y]=meshgrid(xa,ya);
a=1;b=1;c=1;% 假设a=1;b=1;c=1
z1=sqrt(c.^2*(x.^2/(a.^2)+y.^2/(b.^2)-1));
z2=-sqrt(c.^2*(x.^2/(a.^2)+y.^2/(b.^2)-1));
mesh(x,y,z1)
hold on;
mesh(x,y,z2)
%%%%%%%%%%双叶双曲面%%%%%%%%%%%%%%
xa=-2:0.2:2;
ya=xa;
[x,y]=meshgrid(xa,ya);
a=1;b=1;c=1;% 假设a=1;b=1;c=1
z1=sqrt(c.^2*(x.^2/(a.^2)+y.^2/(b.^2)+1));
z2=-sqrt(c.^2*(x.^2/(a.^2)+y.^2/(b.^2)+1));
mesh(x,y,z1)
hold on;
mesh(x,y,z2)
%%%%%%%%%%椭圆抛物面%%%%%%%%%%%%%%
xa=-2:0.2:2;
ya=xa;
[x,y]=meshgrid(xa,ya);
p=1;q=1;% 假设p=1;q=1
z=0.5*(x.^2/p+y.^2/q);
mesh(x,y,z)
%%%%%%%%%%双曲抛物面%%%%%%%%%%%%%
xa=-2:0.2:2;
ya=xa;
[x,y]=meshgrid(xa,ya);
p=1;q=1;% 假设p=1;q=1
z=0.5*(x.^2/p-y.^2/q);
mesh(x,y,z)

花画圆的程序:for i=-3:0.001:3y=-sqrt(9-i^2);plot(i,y);hold onendhold onfor i=-3:0.001:3y=sqrt(9-i^2);plot(i,y);hold onend%椭圆for i=-6:0.01:6y=-sqrt(36-i^2)/2;plot(y,i);hold onend%双曲线for i=-6:0.01...