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

📄 findmiddlepoint.asv

📁 自己编写的 matlab gui 可以实现任意多边形定点参数输入 然后使用Sutherland_Hodgeman等算法进行多边形被矩形截取的演示程序
💻 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 + -