📄 intersectp.m
字号:
function p=intersectp(p1,p2,zonepoint,error,andbit,type)
e=99999;
while (e>=error)
p0=(p1+p2)/2; %find the middle point;
code=getzonecode(zonepoint,p0);
code=bitand(code,andbit); %only judge the first window line
if type~=0 %means p1 outside the area while p2 inside
if code~=0 %the middle point is outside the area
e=norm(p1-p0);
p1=p0;
else %the middle point is inside the area
e=norm(p2-p0);
p2=p0;
end
else %means p1 inside the area while p2 outside
if code~=0 %the middle point is outside the area
e=norm(p2-p0);
p2=p0;
else %the middle point is inside the area
e=norm(p1-p0);
p1=p0;
end
end
end
p=p0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -