I would like to take a convex polygon and fit it into a given rectangle by turning and scaling.
My approach is to turn the polygon in small steps (like 1°) and always measure the fraction (maximal horizontal distance / maximal vertical distance), take the one that is nearest to fraction (rectangle width / rectangle height) and scale it to fit into the rectangle.
I wonder whether there is a "less primitive" approach. Furthermore there might be a better definition of "best fit" than just measuring maximal horizontal and vertical distance. My real aim is to make the polygon "look good", when I store it an image file or print it on a page.