Difference between revisions of "Thread:User talk:Wompi/Questions/reply (4)"

From Robowiki
Jump to navigation Jump to search
(Reply to Questions)
 
 
Line 1: Line 1:
Yeah, I had a similar idea to Chase. Sort the targets in radial order (possibly using a custom comparator if you already have one?), then when looking for the closest for a specific target just check the ones on the left and the right to see which is closest. Use (index + list.size())%list.size() on the index for the left and right value so that it automatically wraps back to the beginning/end when you go over the edge. This approach would be the fastest, but I'm not sure it would be the smallest in terms of codesize.
+
Hmmm... what are you trying to use this for? I don't think I quite understood the question. Are you trying to get the biggest angle between any two in consecutive radial order? Or the one which is the closest to 180 degrees from it?

Latest revision as of 18:05, 23 April 2012

Hmmm... what are you trying to use this for? I don't think I quite understood the question. Are you trying to get the biggest angle between any two in consecutive radial order? Or the one which is the closest to 180 degrees from it?