splitinto4.m

来自「quadtree implementation in matlab」· M 代码 · 共 36 行

M
36
字号
% % given the size of rectangle (matrix end points), it split into four
% % regions and return the starting coordinates (top left corner) and size of each region. 
% % ------------------
% % |        |       |
% % ------------------
% % |        |       |
% % ------------------
function [b1r,b1c,b2r,b2c,b3r,b3c,b4r,b4c,szr,szc]=splitinto4(ir,ic)

szr=round(ir/2);
szc=round(ic/2);

b1r=1;
b1c=1;

b2r=1;
b2c=szc+1;

b3r=szr+1;
b3c=1;

b4r=szr+1;
b4c=szc+1;

% % -------------------------------------------------------------------------
% % This program or any other program(s) supplied with it does not provide any
% % warranty direct or implied. This program is free to use/share for
% % non-commercial purpose only, for any other usage contact with author.
% % Kindly reference author.
% % Thanking you.
% % @ Copyright M Khan
% % Email: mak2000sw@yahoo.com
% %        mak2000@GameBox.net 
% % http://www.geocities.com/mak2000sw

⌨️ 快捷键说明

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