Given that there is a set of points, for example, {{3,4,2},{5,2,-1}}. How do I go about selecting the point that has the lowest absolute x, y or z-coordinate from the list? In this case, the point selected should be {{5,2,-1}} as 1 is the lowest absolute value among all the points. Would the command Select[{{3,4,2}, {5,2,-1}}, ...] be good enough to perform such operation? Specifically, my understanding is that Select[{{3,4,2}, {5,2,-1}}, ...] is useful for selecting each individual point that satisfies certain condition stated in the command, so the question is whether it would be possible to compare 2 different points to select the desired point under the Select[...] operation. Or would there be a better alternative to getting the desired point?
|
|
||||
|
|
|
Since Min returns the smallest element of any of the lists, you can use Position:
|
|||||||||
|
|
So
gives
|
|||||||
|
|
There's a little function I call
This function gives yet another simple solution to your question:
Note that an inherent problem with using |
||||
|
|
