资源简介

NURbs曲线绘制,通过MATLAB绘制NUrbs曲线

资源截图

代码片段和文件信息

clear; 
U=input(‘please input U: ‘); 
X=input(‘please input X: ‘);
Y=input(‘please input Y: ‘); 
Z=input(‘please input Z: ‘);
W=input(‘please input W: ‘); 
for i=7:length(W) 
M{i-3}(14)=0;M{i-3}(34)=0;M{i-3}(24)=0; 
M{i-3}(11)=(U(i+1)-U(i)).^2/(U(i+1)-U(i-1))./(U(i+2)-U(i-1)); 
M{i-3}(13)=(U(i)-U(i-1)).^2/(U(i+1)-U(i-1))./(U(i+2)-U(i-1)); 
M{i-3}(23)=3.*(U(i)-U(i-1)).*(U(i+1)-U(i-1))./(U(i+1)-U(i-1))./(U(i+2)-U(i-1)); 
M{i-3}(33)=3.*(U(i+1)-U(i)).^2/(U(i+1)-U(i-1))./(U(i+2)-U(i-1)); 
M{i-3}(44)=(U(i+1)-U(i)).^2/(U(i+2)-U(i))./(U(i+3)-U(i)); 

M{i-3}(12)=1-M{i-3}(11)-M{i-3}(13);  
M{i-3}(21)=-3.*M{i-3}(11); 
M{i-3}(22)=3.*M{i-3}(11)-M{i-3}(23); 
M{i-3}(31)=3.*M{i-3}(11); 
M{i-3}(32)=-3.*(M{i-3}(21)+M

评论

共有 条评论