final double nw1 = this.northwest.bounds.calcDistance(x1, y1); if ( nw1 <= maxDistance && nw1 + this.northwest.bounds.calcDistance(x2, y2) <= maxDistance) { this.northwest.getElliptical(x1, y1, x2, y2, maxDistance, values); final double ne1 = this.northeast.bounds.calcDistance(x1, y1); if (ne1 <= maxDistance && ne1 + this.northeast.bounds.calcDistance(x2, y2) <= maxDistance) { this.northeast.getElliptical(x1, y1, x2, y2, maxDistance, values); final double se1 = this.southeast.bounds.calcDistance(x1, y1); if (se1 <= maxDistance && se1 + this.southeast.bounds.calcDistance(x2, y2) <= maxDistance) { this.southeast.getElliptical(x1, y1, x2, y2, maxDistance, values); final double sw1 = this.southwest.bounds.calcDistance(x1, y1); if (sw1 <= maxDistance && sw1 + this.southwest.bounds.calcDistance(x2, y2) <= maxDistance) { this.southwest.getElliptical(x1, y1, x2, y2, maxDistance, values);
/* default */ Collection<T> get(final double x, final double y, final double maxDistance, final Collection<T> values) { if (this.hasChilds) { if (this.northwest.bounds.calcDistance(x, y) <= maxDistance) { this.northwest.get(x, y, maxDistance, values); if (this.northeast.bounds.calcDistance(x, y) <= maxDistance) { this.northeast.get(x, y, maxDistance, values); if (this.southeast.bounds.calcDistance(x, y) <= maxDistance) { this.southeast.get(x, y, maxDistance, values); if (this.southwest.bounds.calcDistance(x, y) <= maxDistance) { this.southwest.get(x, y, maxDistance, values);
closest = bestChild.get(x, y, bestDistance); if (bestChild != this.northwest && this.northwest.bounds.calcDistance(x, y) < bestDistance.value) { T value = this.northwest.get(x, y, bestDistance); if (value != null) { closest = value; } if (bestChild != this.northeast && this.northeast.bounds.calcDistance(x, y) < bestDistance.value) { T value = this.northeast.get(x, y, bestDistance); if (value != null) { closest = value; } if (bestChild != this.southeast && this.southeast.bounds.calcDistance(x, y) < bestDistance.value) { T value = this.southeast.get(x, y, bestDistance); if (value != null) { closest = value; } if (bestChild != this.southwest && this.southwest.bounds.calcDistance(x, y) < bestDistance.value) { T value = this.southwest.get(x, y, bestDistance); if (value != null) { closest = value; }
private void stepInto(Node node, double x, double y, double r_min, double r_max, Collection<T> values) { double minDistance = node.bounds.calcDistance(x, y); double maxDistance = node.bounds.calcMaxDistance(x, y); if(minDistance <= r_max && maxDistance >= r_min) { node.get(x, y, r_min, r_max, values); } }