I have an array of 2D Cartesian points in MATLAB and I'd like to sort them so that putting them into plot
would create a polygon with no line overlaps.
(NB. I'm not actually going to plot in MATLAB, I just need to sort them in that manner)
I'm thinking of writing a loop that would find the polar coordinate system's 'theta' for a vector going from a new point I know to be inside the polygon to each of the polygon's points, then sorting according to that value, but it seems very hacky and inefficient!
Any tips?