mirror of https://github.com/apache/lucene.git
Return CELL_CROSSES_QUERY when point inside the triangle (#1259)
This commit is contained in:
parent
2b4fad53e5
commit
ebec456602
|
@ -72,7 +72,7 @@ final class Point2D implements Component2D {
|
|||
return contains(ax, ay) ? PointValues.Relation.CELL_INSIDE_QUERY : PointValues.Relation.CELL_OUTSIDE_QUERY;
|
||||
}
|
||||
if (Component2D.pointInTriangle(minX, maxX, minY, maxY, x, y, ax, ay, bx, by, cx, cy)) {
|
||||
return PointValues.Relation.CELL_INSIDE_QUERY;
|
||||
return PointValues.Relation.CELL_CROSSES_QUERY;
|
||||
}
|
||||
return PointValues.Relation.CELL_OUTSIDE_QUERY;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class TestPoint2D extends LuceneTestCase {
|
|||
double by = 0;
|
||||
double cx = 0;
|
||||
double cy = 1;
|
||||
assertEquals(Relation.CELL_INSIDE_QUERY, point2D.relateTriangle(ax, ay, bx, by , cx, cy));
|
||||
assertEquals(Relation.CELL_CROSSES_QUERY, point2D.relateTriangle(ax, ay, bx, by , cx, cy));
|
||||
assertEquals(Component2D.WithinRelation.CANDIDATE,
|
||||
point2D.withinTriangle(ax, ay, random().nextBoolean(), bx, by, random().nextBoolean(), cx, cy, random().nextBoolean()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue