How to find a center of polygon?

I have a polygon, one in three types: convex, non-convex, with holes) that include sa list of vertices (point x,y) and edges (start point, end point). Now I have to find one point to put a label within the polygon and is center of largest part. How do I do that?

Upvotes: 1

Views: 2425

Answers (1)

BergListe
BergListe

Reputation: 433

A good way to start from is IMO

http://en.wikipedia.org/wiki/Centroid and http://en.wikipedia.org/wiki/K-means_clustering

At the end of the latter you find some links to implementations, maybe these are of help for you.

Upvotes: 3

Related Questions