From ae6fa03b218ef249b4b343b65d51b4d203cb8a13 Mon Sep 17 00:00:00 2001 From: shawnhatch Date: Wed, 20 Nov 2024 01:13:31 -0500 Subject: [PATCH] Altered tolerance value used to determine perpendicularity between vectors to better match expected precision with doubles. --- src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector2D.java | 2 +- src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector3D.java | 2 +- src/main/java/gov/hhs/aspr/ms/util/vector/Vector2D.java | 2 +- src/main/java/gov/hhs/aspr/ms/util/vector/Vector3D.java | 2 +- .../java/gov/hhs/aspr/ms/util/vector/AT_MutableVector2D.java | 2 +- .../java/gov/hhs/aspr/ms/util/vector/AT_MutableVector3D.java | 2 +- src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector2D.java | 2 +- src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector3D.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector2D.java b/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector2D.java index eee2e8f..d3fcd88 100644 --- a/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector2D.java +++ b/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector2D.java @@ -508,7 +508,7 @@ public void zero() { y = 0; } - public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-13; + public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-8; /** * Returns true if and only if this {@link MutableVector2D} is perpendicular to diff --git a/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector3D.java b/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector3D.java index 6d1ea81..3d8a1ec 100644 --- a/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector3D.java +++ b/src/main/java/gov/hhs/aspr/ms/util/vector/MutableVector3D.java @@ -942,7 +942,7 @@ public void zero() { assign(0, 0, 0); } - public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-13; + public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-8; /** * Returns true if and only if this {@link MutableVector3D} is perpendicular to diff --git a/src/main/java/gov/hhs/aspr/ms/util/vector/Vector2D.java b/src/main/java/gov/hhs/aspr/ms/util/vector/Vector2D.java index f7c2202..38bcdec 100644 --- a/src/main/java/gov/hhs/aspr/ms/util/vector/Vector2D.java +++ b/src/main/java/gov/hhs/aspr/ms/util/vector/Vector2D.java @@ -383,7 +383,7 @@ public String toString() { return "Vector2D [x=" + x + ", y=" + y + "]"; } - public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-13; + public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-8; /** * Returns true if and only if this {@link Vector2D} is perpendicular to the diff --git a/src/main/java/gov/hhs/aspr/ms/util/vector/Vector3D.java b/src/main/java/gov/hhs/aspr/ms/util/vector/Vector3D.java index f3496a1..8ec1139 100644 --- a/src/main/java/gov/hhs/aspr/ms/util/vector/Vector3D.java +++ b/src/main/java/gov/hhs/aspr/ms/util/vector/Vector3D.java @@ -14,7 +14,7 @@ public final class Vector3D { public final static double NORMAL_LENGTH_TOLERANCE = 1E-13; - public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-13; + public final static double PERPENDICULAR_ANGLE_TOLERANCE = 1E-8; /* * A function that returns the value if the value is in the interval [-1,1]. diff --git a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector2D.java b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector2D.java index 9224f87..ca80ec9 100644 --- a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector2D.java +++ b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector2D.java @@ -26,7 +26,7 @@ public void testNormalLengthTolerance() { @Test @UnitTestField(target = MutableVector2D.class, name = "PERPENDICULAR_ANGLE_TOLERANCE") public void testPerpendicularAngleTolerance() { - assertEquals(1E-13, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); + assertEquals(1E-8, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); } /** diff --git a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector3D.java b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector3D.java index 301e1c1..4f67408 100644 --- a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector3D.java +++ b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_MutableVector3D.java @@ -26,7 +26,7 @@ public void testNormalLengthTolerance() { @Test @UnitTestField(target = MutableVector3D.class, name = "PERPENDICULAR_ANGLE_TOLERANCE") public void testPerpendicularAngleTolerance() { - assertEquals(1E-13, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); + assertEquals(1E-8, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); } /** diff --git a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector2D.java b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector2D.java index b6e85ad..0180e10 100644 --- a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector2D.java +++ b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector2D.java @@ -27,7 +27,7 @@ public void testNormalLengthTolerance() { @Test @UnitTestField(target = Vector2D.class, name = "PERPENDICULAR_ANGLE_TOLERANCE") public void testPerpendicularAngleTolerance() { - assertEquals(1E-13, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); + assertEquals(1E-8, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); } /** diff --git a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector3D.java b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector3D.java index 8034fa7..e5c2051 100644 --- a/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector3D.java +++ b/src/test/java/gov/hhs/aspr/ms/util/vector/AT_Vector3D.java @@ -27,7 +27,7 @@ public void testNormalLengthTolerance() { @Test @UnitTestField(target = Vector3D.class, name = "PERPENDICULAR_ANGLE_TOLERANCE") public void testPerpendicularAngleTolerance() { - assertEquals(1E-13, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); + assertEquals(1E-8, MutableVector2D.PERPENDICULAR_ANGLE_TOLERANCE, 0); } /**