# Find the area bound by two intersecting circles and a tangent line to one of the circles

There is a circle with radius r1 and centre D

This intersects a circle with radius r2 and centre C

Tangent line AB is always tangential to circle with centre D

It can be assumed the circle with centre C is free to move, and can be both inside and outside of circle D, with centre C also being able to be either side of the tangent line - I will update with edited images and scenarios (an all encompassing is the dream haha!)

Updated query - Is there a way to find the area bound shaded green/yellow? I have been around the houses subtracting sectors and am struggling to find my mistakes, to the point I believe my apporach may well be (is!) off, so I'm not looking to lead anyone!

UPDATE - That said, hold the phone, can we get there by adding green (just intersecting circles equation), and yellow as being:


Yellow = [Area_tri BPA] - [Area_Segment BDP] + [Area_Segment ACP]

I updated the image to better reflect all scenarios of where circle C can be in relation to the tangent line and circle D

I'll clean this query all up once we resolve so it is less cluttered!

I have code which currently can move circle C so that it intersects only the tangent line (area cut from C = segment) and also for when it is only the circles C&D intersecting (area cut from C = circles intersection) and when no intersection with tangent or circle D, (area cut from C = 0)

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Commented Apr 20, 2022 at 15:09
• Where is point $B$ with respect to the $CD$ line? If you move $B$, the area between $AB$ and $P$ will change. Commented Apr 20, 2022 at 15:18
• Angles $\alpha_1$ and $\alpha_2$ are connected with distance $d$ by sine and cosine rule, so there is only one independent value of three. But this value is not sufficient to find area, because you need to add angle $CDB$. For specific location of $C$ shown in picture green area is sum of sector $ACQ$ (I suppose $A$ is on circle with center $C$), triangles $ACB$, $BCQ$ and circular segment $BDQ$. Commented Apr 20, 2022 at 16:57
• Interesting, I will try this out tomorrow (I'm in the UK time zone!) From what you say @IvanKaznacheyeu - presumably that calculation changes only if C is to the left of the tangent? Or do you anticipate being above line BD to be differing scenarios as well? Commented Apr 20, 2022 at 21:29
• @Andrei - It can be assumed that C can move and area changes, so I was looking toward a generic formula, although it looks like there may be differing scenarios based on C being in/out of circle D && left/right of the tangent line? Currently my code on my project copes well with if: - Circle with centre C "only" interacts with the tangent line (just a segment) - Only C and D interact (intersecting circles) - Nothing interacts (area = 0) - So it's only this case I believe that is left for when they all interact Commented Apr 20, 2022 at 21:32

Let the point $$D$$ of your diagram be the origin of the coordinate system and define the center of the smaller circle at point $$C$$ $$(x_C,y_C)$$. We then have the equations for the two circles (when $$y_C < 0$$), $$y=\pm \sqrt{r_1^2 -x^2}\\ y=\pm \sqrt{r_2^2 -(x+x_C)^2}-y_C$$ To find the intersection of the two circles, points $$P$$ and $$Q$$, equate the above equations to determine $$(x_P,y_P)$$ and $$(x_Q,y_Q)$$. Doing the algebra we find, $$x_P = -x_C (\frac{ x_C^2 + r_1^2 - r_2^2}{x_C^2 + y_C^2}) + \sqrt{x_C^2 (\frac{ x_C^2 + r_1^2 - r_2^2}{x_C^2 + y_C^2})^2-\frac{[(x_C^2 - y_C^2 + r_1^2 - r_2^2)^2 + 4y_C^2 (x_C^2 - y_C^2)]}{x_C^2 + y_C^2}}\\ y_P=\sqrt{r_1^2 - x_P^2}\\ x_Q = -x_C (\frac{ x_C^2 + r_1^2 - r_2^2}{x_C^2 + y_C^2}) - \sqrt{x_C^2 (\frac{ x_C^2 + r_1^2 - r_2^2}{x_C^2 + y_C^2})^2-\frac{[(x_C^2 - y_C^2 + r_1^2 - r_2^2)^2 + 4y_C^2 (x_C^2 - y_C^2)]}{x_C^2 + y_C^2}}\\ y_Q=-\sqrt{r_1^2 - x_Q^2}$$
Denote the line segment $$PQ$$ by $$L$$ $$L^2=(x_P - x_Q)^2 + (y_P - y_Q)^2$$ and from the opposite angle formula of trigonometry, $$L^2= 2r_1^2 - 2r_1^2\cos(\theta_1)\\ \cos(\theta_1)=1-\frac{L^2}{2r_1^2}$$ The area of the isosceles triangle in the big circle is $$\frac{1}{2}Lh\\ h=r_1\cos(\frac{\theta_1}{2})\\ \cos(\frac{\theta_1}{2})=\sqrt{\frac{\cos(\theta_1)+1}{2}}=\sqrt{1-\frac{L^2}{4r_1^2}}\\ \frac{1}{2}Lh=\frac{1}{2}Lr_1 \sqrt{1-\frac{L^2}{4r_1^2}}$$ The area of the piece of the pie subtended in the big circle by $$\theta_1$$ is $$\frac{1}{2}r_1^2 \theta_1$$, therefore the area of overlap below the line segment $$L$$ is $$\frac{1}{2}r_1^2\cos^{-1}(1-\frac{L^2}{2r_1^2})-\frac{1}{2}Lr_1 \sqrt{1-\frac{L^2}{4r_1^2}}$$ In like manner we find the area of overlap above the line segment $$L$$, $$\frac{1}{2}r_2^2\cos^{-1}(1-\frac{L^2}{2r_2^2})-\frac{1}{2}Lr_2 \sqrt{1-\frac{L^2}{4r_2^2}}$$ and thus the area of the overlap of the two circles (green region in you diagram) is $$\frac{1}{2}[r_2^2\cos^{-1}( 1-\frac{L^2}{2r_2^2})+r_1^2\cos^{-1}(1-\frac{L^2}{2r_1^2})-L(r_2 \sqrt{1-\frac{L^2}{4r_2^2}} + r_1 \sqrt{1-\frac{L^2}{4r_1^2}})]$$ The area in the region
of your diagram is $$\int_{x_B=-r_1}^{x_P} (\sqrt{r_2^2 -(x+x_C)^2}-y_C)dx-\int_{x_B=-r_1}^{x_P} (\sqrt{r_1^2 -x^2})dx\\ =\frac{1}{2}(x_C + x_P)\sqrt{r_2^2 - (x_C + x_P)^2}-\frac{1}{2}(x_C - r_1)\sqrt{r_2^2 - (x_C + r_1)^2}\\ -y_C (x_P + r_1)\\ - \frac{1}{2}\sqrt{r_1^2 - x_P^2} + \frac{1}{2}r_2^2\tan^{-1}(\frac{x_C + x_P}{\sqrt{r_2^2 - (x_C + x_P)^2}})\\ -\frac{1}{2}r_2^2\tan^{-1}(\frac{x_C - r_1}{\sqrt{r_2^2 - (x_C - r_1)^2}}) + \frac{1}{2}r_1^2\tan^{-1}(\frac{x_P}{\sqrt{r_1^2-x_P^2}}) + \frac{r_1^2\pi}{4}$$