Hard to believe it’s been more than a year! Anyways, I have a new problem, inspired by a piece of cast iron cookware that I want to store safely. A correct solution isn’t particularly difficult, but there appear to be plenty of inefficient ways to approach the problem.

A part’s cross section is the union of a circle of diameter D, and a rectangle of size L-by-W which shares its center with the circle. L≥D≥W. What is the smallest breadth B of a box with width D which can contain the part? (This is a 2-D problem; if you want to got 3-d, assume this is a really long or really short cylinder.)

- (really easy) Under what conditions can the shape fit in a square size DxD?
- For sizes larger than that, what is B? If your solution generates ambiguous solutions*, describe fully how to disambiguate. (Good enough to write a bit of software to do it.).

* E.g. if you take an inverse trig function, define how to select among quadrants.