/** returns true if the query intersects the provided triangle (in encoded space) */ private boolean queryIntersects(int ax, int ay, int bx, int by, int cx, int cy) { // check each edge of the triangle against the query if (edgeIntersectsQuery(ax, ay, bx, by) || edgeIntersectsQuery(bx, by, cx, cy) || edgeIntersectsQuery(cx, cy, ax, ay)) { return true; } return false; }