Given a circle centered at $A$, with radius $R_a$ and another radius $R_b$, I need to find a center for circle $B$ such that both circles are tangential, and the bounding box including both circles complies with ${height\over width}=k$
[Math] Bounding box enclosing circles, that complies with ratio constraints
circleseuclidean-geometry
Related Solutions
So you know the distance $d=CD$ between center and boundary. Then you can write
$$\cos\angle ECD = \tfrac dr \qquad \angle ECF = 2\angle ECD = 2\arccos\tfrac dr$$
Now the length of an arc is $r$ times its angle, so the outside arc is $r\angle ECF$ and the inside arc is
$$s = r(2\pi-\angle ECF)=2r(\pi-\arccos\tfrac dr)$$
You want that number to be equal to some given value, so you want to solve the above equation for $r$. Unfortunately, that equation is transcendental, so you can't expect a closed form solution to your problem. Your best bet is some form of iterative numeric approximation.
As you can see from that plot, you can expect that for many possible ratios of $\frac sd$, you get two distinct solutions for $r$.
The apex (with the vertical tangent) appears to be at
$$ s/d\approx 5.94338774142760424162091392488776998544210982523814509283191138267355981 \\ r/d\approx 1.06193134974748196175464922830803488867448733227482933642882008697882597 $$
I have put a Geogebra sheet at https://www.geogebra.org/m/qnFkgnev. I am going to write the 4 equations needed to solve for the smallest circle. A convention that I am using: If I have fixed the value of a point, then it is addressed as $(x(P),y(P))$, whereas, if I have the point as an unknown, it is addressed as $(P_x,P_y)$ In the Geogebra sheet, you can move point C about but the browser is slow. So, click, hold down and move cursor to a new spot on the circle, release. Wait a few seconds and hopefully all will recalculate/redraw. My 4 unknowns are $D_x,D_y,E_x,E_y$
Unknown point D, is on the line between B & C. m is the slope of that line. $$m=\left(\frac{y(B)-y(C)}{x(B)-x(C)}\right)$$ The equation: $$D_y=y(C)+m(D_x-x(C))$$
The radius of the small circle is the same between C & D and between E & D. $$|C-D|=|E-D|$$
Point E has to lie on circle A. $$E_x^2+E_y^2-3E_x-3E_y=4.5$$ (I think this circle is hard coded in the geogebra sheet, hence the numerical values shown in this equation.)
Point D must lie on a line from A through E. $$m_1=\left(\frac{E_y-y(A)}{E_x-x(A)}\right)$$ and the equation: $$D_y=E_y+m_1(D_x-E_x)$$
Once these were solved (by Geogebra CAS), I could move the fixed point C about and a new point D was generated. I saved these using $SetValue(D_n,D)$. Next I chose 3 of the D values and put a circle through them. Surprise (or not), that circle does not quite go through all of the D values. i.e. the locus of points in question do not quite make the arc of a circle. Is it an ellipse? Maybe, but that certainly isn't proven yet.
Best Answer
By scaling one can assume that $R_a=1$, and we can put $R_b=r$. This answer only looks at the case where the second circle of radius $r$ is positioned so that its point of tangency with the unit circle (center at $A=(0,0)$ lies in the first quadrant. We also assume that the $r$ circle protudes enough in the $x$ direction so that the bbox needs to extend to the right of $x=1$, and that the $r$ circle is far enough down from the top that the entire $r$ circle lies below the line $y=1$.
The center of the $r$ circle lies at $((1+r) \cos \theta, (1+r) \sin \theta)$ where $\theta$ is the angle formed by the center of the $r$ circle, the origin, and the positive $x$ axis. Then the condition that the $r$ circle lies below $y=1$ is $$[1]\ \ \ r+(1+r)\sin \theta \le 1.$$ And the condition that the $r$ circle protrudes beyond the line $x=1$ is $$[2]\ \ \ r+(1+r)\cos \theta \ge 1.$$ The ratio $k$ under these assumptions comes from the fact that, in this situation, the height of the bbox is $2$ while its width, extending from $x=-1$ to the rightmost point of the $r$ circle, is $1+(1+r)\cos \theta +r$. This gives the ratio as $$k = \frac{2}{(1+r)(1+\cos \theta)},$$ which solves for $\cos \theta$ as $$\cos \theta=\frac{2}{k(1+r)}-1.$$ One can then find $\theta$ via arccos. Even in this simple case, it is necessary to know that [1] and [2] are satisfied, in order for the expression for $\cos \theta$ to achieve $k$ be valid. I've attempted to eliminate $\cos \theta$ and $\sin \theta$ from conditions [1] and [2], but it gets involved.
Note that here the value of $k$ must lie in the interval $[1/(1+r),1]$ in order for there to be a possible $r$ circle, where the smallest $k$ corresponds to the case where the $r$ circle is tangent to the unit circle at $(1,0)$. One naturally also needs $r<1$ or else the $r$ circle will extend beyond $y=1$ and change the formula for $k$.
It remains to look at other cases, for example the case wherein the $r$ circle extends both to the right of $x=1$ and above $y=1$. And the conditions [1] and [2] need to be restated without $\theta$, for a complete answer. There may be another way to look at this question, which would not involve so many cases and conditions.