使用matlab绘画双叶双曲面怎么画?

方程,x^2-y^2-z^2=1,请帮我把程序写出来,谢谢。... 方程,x^2-y^2-z^2=1,请帮我把程序写出来,谢谢。 展开
 我来答
ae2ew7
2019-09-18 · TA获得超过949个赞
知道小有建树答主
回答量:1147
采纳率:69%
帮助的人:114万
展开全部
%%%%%%%%%圆%%%%%%%%%%%%%%
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)
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式