boostorg / boostorg/geometry

centroid overflow for multipoint with integer coords

Open
#512 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

centroid just sums all points and divide result on point count, but it should use "extended" type.
Example:
{{x = 989466522, y = 789595328}, {x = 989472652, y = 789598701}, {x = 989481089, y = 789595346}, {x = 989484158, y = 789593666}, {x = 989484932, y = 789586937}, {x = 989482640, y = 789580203}, {x = 989478814, y = 789574309}, {x = 989471911, y = 789576825}, {x = 989466522, y = 789595328}}
Result: {x = 315354648, y = -1483637949}
Expected result: {x = 989476582, y = 789588516}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.