I want to find minimal enclosing rectangle for set of n points. First I found convex hull. If I have a convex hull from set of points ( I got it by doing Graham scan) stored as a sorted list. And from every edge of that convex hull, by binary search I found the point with the most distance. Now having that one edge and point with max distance, how can I find the rest of 2 points so I could make a rectangle. I know that at least two points of extremes of that convex hull must be on minimal enclosing rectangle (Xmin, Xmax, Ymin, Ymax). How can I use that? Does one need to be on edge of polygon and is there any way to do it like this? Reason I am doing this way is that I need O(nlogn) time complexity. Every help is appreciated.
Example:
In this example we have Xmin and Ymax on rectangle, but not Xmin or X max