Find and sort 2d array elements like radar I don't know relevant keywords about this algorithm.
I can show you visually




Any ideas are appreciated
For each of your points in the field, calculate the red angle:
    

Then sort all the (point, angle)-tuples by the angle.