Note: Everything about the circle is unknown. Only the width and height of the rectangle are known.
I devised a formula to determine the diameter of circle, so that the circle's perimeter intersects with the bottom two corners of a rectangle, whatever the proportion of the rectangle is (or at least if the width is greater than the height). The formula is as follows, whereby W refers to the width and H refers to the height of the rectangle:
X = W / H
Diameter = ((X/4) + (1/X)) * W
Does anybody know a more eloquent way to calculate this or is there a known algorithm to do this more efficiently?
