Improve radius level math
This commit is contained in:
parent
84fdb9b6db
commit
727b6ba399
1 changed files with 10 additions and 2 deletions
|
@ -747,12 +747,20 @@ public class SearchPhrase {
|
|||
}
|
||||
|
||||
}
|
||||
public int getRadiusSearch(int meters, int radiusLevel) {
|
||||
int res = meters;
|
||||
for(int k = 0; k < radiusLevel; k++) {
|
||||
res = res * (k % 2 == 0 ? 2 : 3);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public int getRadiusSearch(int meters) {
|
||||
return (1 << (getRadiusLevel() - 1)) * meters;
|
||||
return getRadiusSearch(meters, getRadiusLevel() - 1);
|
||||
}
|
||||
|
||||
public int getNextRadiusSearch(int meters) {
|
||||
return (1 << (getRadiusLevel())) * meters;
|
||||
return getRadiusSearch(meters, getRadiusLevel());
|
||||
}
|
||||
|
||||
public static int icompare(int x, int y) {
|
||||
|
|
Loading…
Reference in a new issue