This is a nice little puzzle challenge.
I have a list of collection of points on the screen. I want to order them based on their distance from a seperate, independent point. What's working is I have a function GetDistance which does the dirty pythagorian work of returning the distance between two points.
Let me explain more in the code block below...
Thanks for any help in advance.Code:'Create the set point from which to start all measurements from (startpoint) dim SetPoint as new Point(200,200) 'Create a list to hold arbitrary points to test (endpoints) dim ListOfPoints as new list(of point) 'Add points to test ListOfPoints.Add(1000,2000) ListOfPoints.Add(340,400) ListOfPoints.Add(1022,53) ListOfPoints.Add(333,987) 'The code should now rearrange the above list from closest to furthest from 'the SetPoint using my GetDistance(StartPoint, EndPoint) pythagorian function





Reply With Quote