You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Baljit Singh (Jira)" <ji...@apache.org> on 2020/01/08 01:26:00 UTC

[jira] [Created] (GEOMETRY-86) Point2S.antipodal() is incorrect.

Baljit Singh created GEOMETRY-86:
------------------------------------

             Summary: Point2S.antipodal() is incorrect.
                 Key: GEOMETRY-86
                 URL: https://issues.apache.org/jira/browse/GEOMETRY-86
             Project: Apache Commons Geometry
          Issue Type: Bug
            Reporter: Baljit Singh


The antipodal calculation is invalid. 

{code:java}
    @Test
    public void testAntipodal() {
        Point2S point = Point2S.of(0.0, 0.0).antipodal();
        Point2S copy = Point2S.from(point.getVector());

        System.out.println(point);
        System.out.println(copy);
    }
{code}

This prints:
(0.0, 3.141592653589793)
(3.141592653589793, 3.141592653589793)

SphericalTestUtils.assertPointsEq does not detect the error because the point.getVector() and copy.getVector(0 are equal, and therefore the distance between these points is equal.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)