I am toying around with a shape problem and I am looking for a more clever solution than what I have been able to come up with.
Here is the problem:
I have a set of points that form an enclosed shape on a Cartesian grid, say A(-1,0),B(1,0), and C(0,4) which forms an acute triangle.
The problem I am trying to solve is I need to be able to rotate a well formed shape in such a way that the maximum distance between points on the periphery is as small as it can be. This point is essentially to find a rotation where the shape has the least width possible on the x-axis. The example above would have an answer that is the distance between A and B(I think?)
I can come up with very naive solutions to this for common shapes like rectangles and what have you, but it seems like there must be a universal way to solve this problem that will work for any shape.
Any nudge in the right direction would be greatly appreciated.