You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
207 B
13 lines
207 B
5 years ago
|
function res = getDivByPos(Length, Width, x, y)
|
||
|
|
||
|
ux=Length/4;
|
||
|
uy=Width/2;
|
||
|
|
||
|
x = x + Length/2;
|
||
|
y = y + Width/2;
|
||
|
|
||
|
px = ceil(x/ux);
|
||
|
py = floor(y/uy);
|
||
|
|
||
|
res = px + py*4;
|
||
|
end
|