Re: Minimization
- To: mathgroup at smc.vnet.net
- Subject: [mg42270] Re: [mg42256] Minimization
- From: Cheng Liu <cliu at lanl.gov>
- Date: Thu, 26 Jun 2003 05:36:24 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
This may help:
p0={x0,y0,z0};
fivePoints=Take[Sort[l1,(#2.p0<=#1.p0)&],5]
Cheng
At 11:53 PM 6/24/2003, Moranresearch at aol.com wrote:
>I have a list of points l1= (xi,yi, zi) and a target point (x0,y0,z0) how
>would I efficiently find the 5 points in l1 closest to, ie with the smallest
>Euclidian disance to, the target point? Thank you.
>John
====================================================
Cheng Liu, Ph.D.
MST-8, Structure/Property Relations
Materials Science and Technology Division
Los Alamos National Laboratory
Los Alamos, New Mexico 87545
Phone: 505-665-6892 (office), 505-667-9950 (lab)
Fax: 505-667-8021
email: cliu at lanl.gov
====================================================