Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anlge#interiorAngle produces incorrect result #721

Closed
grimsa opened this issue May 20, 2021 · 0 comments · Fixed by #723
Closed

Anlge#interiorAngle produces incorrect result #721

grimsa opened this issue May 20, 2021 · 0 comments · Fixed by #723

Comments

@grimsa
Copy link
Contributor

grimsa commented May 20, 2021

Test case:
image

    @Test
    void interiorAngle_rightTriangle() {
        // Triangle WKT: "POLYGON ((1 2, 3 2, 2 1, 1 2))"
        var p1 = new CoordinateXY(1, 2);
        var p2 = new CoordinateXY(3, 2);
        var p3 = new CoordinateXY(2, 1);

        assertEquals(45, Math.toDegrees(Angle.interiorAngle(p1, p2, p3)), 0.01);   // returns 315
        assertEquals(90, Math.toDegrees(Angle.interiorAngle(p2, p3, p1)), 0.01);
        assertEquals(45, Math.toDegrees(Angle.interiorAngle(p3, p1, p2)), 0.01);
    }
dr-jts pushed a commit that referenced this issue May 21, 2021
Signed-off-by: grimsa <gediminas.rimsa@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant