Finding 4 Corners in an array of (X,Y) coordinates

asked 2014-10-10 08:50:34 -0600

Good day,

I have an array of points which represent points in a 2d map.

I need to find the topleft, topright, bottomleft, bottomright points in that map. However, there are alot of points in between and out. What is the easiest way I can do this? I could find the value with the highest y, but that might not have the highest x and so on.

Just letting me know the logic would be great.

edit retag flag offensive close merge delete

Comments

look for : topLeft(min_x,min_y) topRight(max_x,min_y) buttomLeft(max_x,max_y) buttomRight(min_x,max_y)
tha is true if the origin is on the top left and x_axis is horizontal y_axis is vertical

chebhou gravatar imagechebhou ( 2014-10-10 11:51:44 -0600 )edit

@soulslicer0 See the answer here might be helpful.

Haris gravatar imageHaris ( 2014-10-10 23:05:32 -0600 )edit