This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-geometry.git

commit 3201a5898a7b7975ad6a1dbe79083f8ed304c253
Author: Matt Juntunen <matt.juntu...@hotmail.com>
AuthorDate: Tue Jan 7 22:18:21 2020 -0500

    GEOMETRY-86: adding test for numerical stability of Point2S.antipodal()
---
 .../commons/geometry/spherical/twod/Point2STest.java       | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/Point2STest.java
 
b/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/Point2STest.java
index 89e973f..4b18cb7 100644
--- 
a/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/Point2STest.java
+++ 
b/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/Point2STest.java
@@ -228,6 +228,20 @@ public class Point2STest {
     }
 
     @Test
+    public void testAntipodal_numericalStability() {
+        // arrange
+        double eps = 1e-16;
+        Point2S pt = Point2S.of(1, 2);
+
+        // act
+        Point2S result = pt.antipodal().antipodal();
+
+        // assert
+        Assert.assertEquals(1.0, result.getAzimuth(), eps);
+        Assert.assertEquals(2.0, result.getPolar(), eps);
+    }
+
+    @Test
     public void testDimension() {
         // arrange
         Point2S pt = Point2S.of(1, 2);

Reply via email to