📄 symdist.m
字号:
% function sd = symdist(i,j,coord,area)%% Arguments:% i,j - node indices% coord - coordinates of nodes% area - size of torus (x,y)%% Returns:% sd - distance between nodes% % calculates distance between nodes <i> and <j> with coordinates from <coord>% assuming they are placed on a torus with dimensions <area>. % function sd = symdist(i,j,coord,area)sd = Inf;cd = [coord(j,:); coord(j,:) + [area(1),0]; coord(j,:) - [area(1),0]; ... coord(j,:) + [0, area(2)]; coord(j,:) - [0, area(1)]];for k=1:5 sd = min(sd, sqrt((coord(i,1)-cd(k,1))^2 + (coord(i,2)-cd(k,2))^2));end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -