Skip to content

Fix for 2D polygon area algorithm #2811

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

Open
wants to merge 1 commit into
base: version/7.3.x
Choose a base branch
from

Conversation

TiagoFar78
Copy link

This PR introduces a new algorithm to calculate the area of 2D polygons using discrete points. The previous implementation was designed for concrete points and did not handle certain cases correctly.

Since the new algorithm is relatively complex, I have also prepared a detailed explanation for reference.

Closes #888

@TiagoFar78 TiagoFar78 requested a review from a team as a code owner July 30, 2025 01:31
@me4502
Copy link
Member

me4502 commented Jul 30, 2025

Thank you for this PR! :)

It looks good to me, although I'll let someone else who's better at maths review that side of things. The only thing I'd personally change are a few unnecessary allocations (& usage of Streams APIs), although none of this is really hot code so it's not too major an issue.

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 this pull request may close these issues.

getArea() and Polygonal2DRegion - don't return real value.
2 participants