I'm having troubles trying to rearrange a set of points where each point is part of the edge of a concave polygone. My set of points is not sorted in any order, they are just randomly put in an array. See the example right below :
My goal is to rearrange these points to be able to build a polygon correctly where the next index in the array is the next point to draw :
I don't know how to do it fast, sometime arrays are made of 200 points, and I have like 20 of these arrays (I would use this to draw islands)
Thank you in advance.