I have a set of points
P1(x1,y1), P2(x2,y2), P3(x3,y3), P4(x4,y4), P5(x5,y5) in the Cartesian plane. I am trying to find the closest point to P1 based on the orientation and Euclidean distance. What I mean is the following:
Suppose that P3 is the closet to P1 and P5 is the second closest, but the angle between P1 and P3 is greater than the angle between P1 and P5.
How can I find this balance between the points?