如何检查多边形是凸的? [英] how to check if polygon is convex?
问题描述
可能重复:
<一href="http://stackoverflow.com/questions/471962/how-do-determine-if-a-polygon-is-complex-convex-nonconvex">How做判断一个多边形是复杂/凸/非凸?
我想知道你将如何检查一个多边形是凸的或没有,是这样做运行一个凸包算法的一个方式,如果在凸包点的数目是一样的数在多边形点,然后这是否意味着它的凸?
I'd like to know how you would check if a polygon is convex or not, is one way of doing it to run a convex hull algorithm and if the number of points in the convex hull is the same as the number of points in the polygon then does that mean it's convex ?
推荐答案
逛完多边形,请检查并确保你正在转向以同样的方式(或左或右,始终如一,整个倒过来)每个节点。
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.
这篇关于如何检查多边形是凸的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!