📄 findmiddlepoint.asv
字号:
function p0=findmiddlepoint(p1,p2,zonepoint)
p0=(p1+p2)/2; %find the middle point;
codep0=getzonecode(zonepoint,p0);
codep1=getzonecode(zonepoint,p1);
codep2=getzonecode(zonepoint,p2);
while codep0~=0 %if the middle point is not in the area, continue to find it
p0=(p1+p2)/2; %find the middle point;
codep0=getzonecode(zonepoint,p0);
if codep0==0 %this point is in the area break;
break;
else %this p0 is not in the area
judge1=bitand(codep0,codep1);
if judge1~=0 %means the p1 can be replaced by p0
p1=p0;
else p2=p0;
end
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -