How to check if polygon is convex? [duplicate]

2019-05-29 10:09发布

Possible Duplicate:
How do determine if a polygon is complex/convex/nonconvex?

I'd like to know how you would check if a polygon is convex or not.

One apparent way of doing it is to run a convex hull algorithm. If the number of points in the convex hull is the same as the number of points in the polygon, does that mean the polygon is convex?

1条回答
叛逆
2楼-- · 2019-05-29 10:47

Walk around the polygon, check that at each node that you are turning the same way (either left or right, consistently, the whole way round).

I think finding the convex hull of a set of points is more complicated than checking if a polygon is convex, so going about it in that way might be less desirable.

查看更多
登录 后发表回答