遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

参数化曲面的绘制

复制代码
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  单双叶互换

posted on   遗忘海岸  阅读(593)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示