Here is image ,

I want to know how to get nearest point to a given point [can be anywhere] [green one] , for array of points. By seeing we can get, but how to do same in code ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Calculate the distance to each point:
Then take the min of that. There are probably more efficient ways of doing it (e.g. octtrees) for very large # of points.