Consider two convex polygons A and B. Polygon B lies completely inside polygon A. I am trying to find the longest line segment (with a fixed slope) such that:
- One end of the line segment lies on the boundary of polygon B, and the other end of the line segment lies on the boundary of polygon A.
Can anyone help me with an algorithm to find that length?
Further, can this be extended to the following:
- Suppose you have two line segments with different slopes (both fixed slopes), such that they have the same endpoint on or inside polygon B and their other endpoints (would be different for the two lines) on the boundary of A. How would I maximize the sum of their lengths?
- Polytopes/ polygons of higher dimensions?