Answer the question
In order to leave comments, you need to log in
Algorithm for sorting an array of points in 3D space relative to a given one?
Greetings!
Is there a fast algorithm for sorting an array of points in 3D space with respect to a given one?
Given:
Point (x, y, z)
Array of points with coordinates
The task is to sort the array in ascending order of distance from the Point.
Added:
Will sorting by AB = |xb - xa| + |yb - ya| + |zb - za| right?
Answer the question
In order to leave comments, you need to log in
Is there a fast algorithm for sorting an array of points in 3D space with respect to a given one?I don't know what you mean by "fast", but my considerations are:
Calculate the distance to each point and sort however you like. Nothing complicated
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question