⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 triangle_uv.m

📁 hodge decomposition for 2D vector fields.
💻 M
字号:

function UV=triangle_uv(triangle,mesh,start_x,start_y,delta_x,delta_y,uu,vv) 
%% generate the Average Vector Table 
%% triangle: the Grid Table 
%% mesh: the Node Table 
%% start_x: start coordinate in horizontal direction 
%% start_y: start coordinate in vertical direction 
%% delta_x: step in horizontal direction 
%% delta_y: step in vertical direction 
%% uu: horizontal component of the input motion field 
%% vv: vertical component of the input motion field 
%% UV: The resulted Average Vector Table 
M=size(triangle,1); 
UV=zeros(M,2);  
for i=1:M 
loc1=mesh(triangle(i,1),:); 
loc2=mesh(triangle(i,2),:); 
loc3=mesh(triangle(i,3),:); 
ind_y1=floor((loc1(1)-start_y)/delta_y)+1; 
ind_x1=floor((loc1(2)-start_x)/delta_x)+1; 
ind_y2=floor((loc2(1)-start_y)/delta_y)+1; 
ind_x2=floor((loc2(2)-start_x)/delta_x)+1; 
ind_y3=floor((loc3(1)-start_y)/delta_y)+1; 
ind_x3=floor((loc3(2)-start_x)/delta_x)+1; 
UV(i,1)=(uu(ind_y1,ind_x1)+uu(ind_y2,ind_x2)+uu(ind_y3,ind_x3))/3; 
UV(i,2)=(vv(ind_y1,ind_x1)+vv(ind_y2,ind_x2)+vv(ind_y3,ind_x3))/3; 
end; 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -