Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Soting objects by diatance from a point

Status
Not open for further replies.

ben017f

Programmer
Joined
Jun 22, 2006
Messages
1
Location
NZ
Hi all,
I have about 1500 objects that have an x and a y property. I would like to be able to sort them by distance from a point in the plane. Something like the following would be great:

x.searchNearest(20,list)

would return a list of the the 20 objects in list that are closest to x in the plane.

I'd just like some ideas to play with on how to impliment this.

Thanks in advance,
Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top