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

MultiPolygon::centroid()の実装(#1186) #1190

Merged

Conversation

Ogame3334
Copy link
Contributor

@Ogame3334 Ogame3334 commented Jan 18, 2024

#1186
MultiPolygon::centroid()を実装しました。
実装の際、変数名が思い浮かばず、長くなってしまいました……。

重心を求めるために$S, v$をそれぞれ、各Polygonの面積、重心として以下の式で求めました。
$$\frac{S_0v_0+S_1v_1+\cdots +S_{N-1}v_{N-1}}{S_0+S_1+\cdots +S_{N-1}}$$

Copy link
Member

@Reputeless Reputeless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 箇所の変更をお願いします。

Siv3D/src/Siv3D/MultiPolygon/SivMultiPolygon.cpp Outdated Show resolved Hide resolved
@Reputeless Reputeless merged commit 8ed25d3 into Siv3D:v6_develop Jan 29, 2024
2 checks passed
@Reputeless
Copy link
Member

Merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants