Ordering random vertices in circle
I'm trying ordering some vertices like picture I attached
and precondition is I know just their coordinate ( x,y)
What I tried to make it before is first I've calculated each vertices'
angle using arctangent like a radar system and tried to put number but It
was failed because some vertices were not given any number like the
picture I attached.
Question 1 : how can I make it correctly ?
Question 2 : Also I want to know the most effective way like this picture.
Of course if I calculated the distance some point to another point I could
find out the shortest way, however I think some algorithm can solve these
two question at the same time.
No comments:
Post a Comment