Exploiting similarity of triangles to express one length in terms of all the rest. I need to express the length $h$ in the depicted figure as a function of the length $D$ (the expression may contain the other parameters as well, except X). The circle $ACEA$ has radius $R+r$ and centre $P$. The circle $ECE$ has radius $R_{s}-r$ and centre $Q$. That is all that is known.  I tried without success to use the similarity of the two right-angles triangles of heights $2r-D$ and $2r-D+h$. Any help would be appreciated. Please note that the point $Q$ is not on the circle $ACEA$.

 A: $AQ = PQ + PA = PQ + (R+r) = (R_s - r) + (2r - D)$ solve for $PQ$
$PQ = R_s-r + 2r-D - R-r = R_s - D -R.$ Cosine theorem for triangle $PQC$
$$(R+r)^2 = (R_s - D -R)^2 + (R_s-r)^2 - 2 \, (R_s - D -R) (R_s-r) \cos(\alpha) $$
where $\alpha = \angle \, PQC$. Then $BC = (R_s - r) \sin(\alpha)$ and $BQ = (R_s - r) \cos(\alpha)$. Power of a point in a circle $$BC^2 = h \, (BQ + R_s-r)$$ so $$h = \frac{BC^2}{BQ + R_s-r}  = \frac{(R_s - r)^2 \sin^2(\alpha)}{ (R_s - r) \cos(\alpha) + R_s-r} = \frac{(R_s - r)^2 (1-\cos^2(\alpha))}{ (R_s - r) \cos(\alpha) + R_s-r}$$ Finally 
$$h =  \frac{(R_s - r)^2 -(R_s - r)^2 \cos^2(\alpha)}{(R_s - r) \cos(\alpha) + R_s-r}$$ where 
$$ (R_s-r) \cos(\alpha) =\frac{(R_s - D -R)^2 + (R_s-r)^2 - (R+r)^2} { 2 \, (R_s - D -R)} $$
If I haven't made too many mistakes, the final answer is
$$h =  \frac{4 \,(R_s - D -R)^2(R_s - r)^2 -\Big((R_s - D -R)^2 + (R_s-r)^2 - (R+r)^2\Big)^2}{2\,(R_s - D -R)\Big((R_s - D -R)^2 + (R_s-r)^2 - (R+r)^2\Big) + 4 \, (R_s-r)(R_s - D -R)^2}$$ which should be a piece of cake for a computer :D 
I think this settles it.  
