假如我有4个顶点在二维空间。做任何事情知道一个有效的算法,这将给我相当于一个简单的四边形的顶点的排序呢?也就是说,它会标注顶点 1,2,3,4
这样,如果我按照 1-2,2-3,3-4
我已经跟踪的简单(即非交叉)四边形。
Suppose I have 4 vertices in 2D space. Does anything know of an efficient algorithm which will give me an ordering of the vertices which corresponds to a simple quadrilateral? That is, it will label the vertices 1, 2, 3, 4
so that if I follow 1-2, 2-3, 3-4
I will have traced a simple (i.e. non-intersecting) quadrilateral.
只是提供一个标准的算法,我可以在google会被罚款的名称。
Just providing the name of a standard algorithm which I can google would be fine.
您可以只是谷歌在顺时针顺序排序点,你会得到如:
You can just google for sorting points in clockwise order and you get e.g.:
排序按顺时针顺序四点 按顺时针顺序排序分?
Sort four points in clockwise order Sort points in clockwise order?