mirror of https://github.com/apache/lucene.git
LUCENE-8171: Check only for exactly zero magnitude vector, and otherwise let the iterative code try to converge.
This commit is contained in:
parent
8a5a4a6317
commit
dd08400a3d
|
@ -106,10 +106,9 @@ public class Vector {
|
|||
final double thisZ = AX * BY - AY * BX;
|
||||
|
||||
final double magnitude = magnitude(thisX, thisY, thisZ);
|
||||
if (magnitude < MINIMUM_RESOLUTION) {
|
||||
if (magnitude == 0.0) {
|
||||
throw new IllegalArgumentException("Degenerate/parallel vector constructed");
|
||||
}
|
||||
|
||||
final double inverseMagnitude = 1.0/magnitude;
|
||||
|
||||
double normalizeX = thisX * inverseMagnitude;
|
||||
|
@ -215,7 +214,7 @@ public class Vector {
|
|||
final double thisZ = A.x * B.y - A.y * B.x;
|
||||
|
||||
final double magnitude = magnitude(thisX, thisY, thisZ);
|
||||
if (magnitude < MINIMUM_RESOLUTION) {
|
||||
if (magnitude == 0.0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ public class RandomPlaneTest extends RandomGeo3dShapeGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
@Repeat(iterations = 10)
|
||||
public void testPlaneThreePointsAccuracy() {
|
||||
|
|
Loading…
Reference in New Issue