Let's say we have two circles whose centers are spaced a fixed $x$ units apart from one another. Both circles have a radius $r$. Our goal is to identify the minimum value of $r$ so that the intersection of the two circles con entirely contain a square of sidelength $w$.
To illustrate this problem, I have attached a diagram below.
Note: In this illustration, the square's center is at the midpoint of the line connecting the two circle centers, and the squares sides are either parallel or perpendicular to that line.
Thus, if we are given a value of $w$ and $x$, how do we find the minimum value of $r$?