matlab三维圆台拟合,使用Matlab画出圆台圆锥圆柱

本文介绍如何利用Matlab进行三维圆台的拟合和绘制,包括创建圆台、圆锥和圆柱的点,进行旋转和填充操作,以及在特定方向上的调整。
摘要由CSDN通过智能技术生成

t=linspace(0,2*pi,n)';

xa2=R(1)*cos(t);

xa3=R(1)*sin(t);

xb2=R(2)*cos(t);

xb3=R(2)*sin(t);

% Creating the points in the X-Direction

x1=[0 length_cyl];

% Creating (Extruding) the cylinder points in the X-Directions

xx1=repmat(x1,length(xa2),1);

xx2=[xa2 xb2];%xx2=repmat(x2,1,2);

xx3=[xa3 xb3];%xx3=repmat(x3,1,2);

% Drawing two filled cirlces to close the cylinder

if closed==1

hold on

EndPlate1=fill3(xx1(:,1),xx2(:,1),xx3(:,1),'r');

EndPlate2=fill3(xx1(:,2),xx2(:,2),xx3(:,2),'r');

end

% Plotting the cylinder along the X-Direction with required length starting

% from Origin

Cone=mesh(xx1,xx2,xx3);

% Defining Unit vector along the X-direction

unit_Vx=[1 0 0];

% Calulating th

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值