参数化曲面的绘制

clc
clear

%椎体
% r=0:0.02:1;
% theta=0:0.02:2*pi;
% [r1,theta1]=meshgrid(r,theta);
% x=r1.*cos(theta1);
% y=r1.*sin(theta1);
% z=r1;

%球体
% fai=0:0.02:pi;
% theta=0:0.02:pi*2;
% a=1
% [fai1,theta1]=meshgrid(fai,theta);
% x=a.*sin(fai1).*cos(theta1);
% y=a.*sin(fai1).*sin(theta1);
% z=a.*cos(fai1);

%圆柱体
theta=0:0.02:pi;
u=0:0.02:5;
[theta1,u1]=meshgrid(theta,u);
x=3.*sin(2.*theta1);
y=6.*sin(theta1).^2;
z=u1;
surf(x,y,z);
axis equal
View Code

 

%柱面
% x=0:0.02:1;
% z=0:0.02:4;
% [x1,z1]=meshgrid(x,z);
% x=x1;
% y=x1.^2;
% z=z1;
% 
% hold on
% quiver3(1/2, 1/4, 1/2,1/10,1/10,0/10,'g') 
% quiver3(1/2, 1/4, 1/2,0/10,0/10,1/7,'r') 
% quiver3(1/2, 1/4, 1/2,1/10,-1/10,0,'y') 

%抛物面
r=0:0.02:2;
theta=0:0.02:2*pi;
[r1,theta1]=meshgrid(r,theta);
x=r1.*cos(theta1);
y=r1.*sin(theta1);
z=r1.^2;
View Code

 

 

空间椭圆曲线参数方程

x+y+z=1 切 x^2+y^2=3形成的空间椭圆

x=3 cos(theta)

y=3 sin(theta)

z=1-x-y

椭圆切面参数方程

theta=0:0.03:2*pi;
r=0:0.05:3;
[r1,theta1]=meshgrid(r,theta);
x=r1.*cos(theta1);
y=r1.*sin(theta1);
z=1-x-y;

surf(x,y,z)
View Code

 

 

%轮胎
v=0:0.03:2*pi;
u=0:0.03:2*pi;
[v1,u1]=meshgrid(v,u);
R=4;
r=1;
x=(R+r.*cos(u1)).*cos(v1);
y=(R+r.*cos(u1)).*sin(v1);
z=r.*sin(u1) ;
surf(x,y,z)
hold on
 quiver3(0, 0, 0,1,0,0,'g') 
 quiver3(0, 0, 0,0,1,0,'g') 
 quiver3(0, 0, 0,0,0,1,'g') 
View Code

 


theta=0:0.03:2*pi;
u=0:0.03:2;
[theta1,u1]=meshgrid(theta,u);
a=4;
b=5;
c=7;
x=a.*sinh(u1).*sin(theta1);
y=b.*sinh(u1).*cos(theta1);
z=c.*cosh(u1);
mesh(x,y,z);

hold on

z=-c.*cosh(u1);
mesh(x,y,z);
grid on
axis equal

 

 

sinh->cosh  单双叶互换

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值