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

关于 Polygon 的面积计算 #138

Open
weilycoder opened this issue Oct 4, 2024 · 2 comments
Open

关于 Polygon 的面积计算 #138

weilycoder opened this issue Oct 4, 2024 · 2 comments

Comments

@weilycoder
Copy link
Contributor

无法正确计算非简单多边形(有自交)的面积

from cyaron import *

p = Polygon(
    [(-3, 4), (1.5, 3), (-6, -2), (-3, -4)]
)
print(p.area()) # output: 3.0

如图,显然面积为 $15$

2024-10-04_19-08

即使这种情形在应用时不常见,是否应在文档中警告,或者在代码逻辑中加入判断?

@Mr-Python-in-China
Copy link
Collaborator

这啥屎山啊

@Mr-Python-in-China
Copy link
Collaborator

不急

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

No branches or pull requests

2 participants