How do I find the points of intersection of two circles?

406 Views Asked by At

I have a specific situation in which I need to find the points of intersection of two circles, $k_1$ and $k_2$.

The first circle, $W$, has coordinates $(0,R)$ and is of radius $R$.

The second circle, $L$, has coordinates $(0,b \cdot r)$ and is of radius $r$. (The circles will only intersect if $-1 \le b \le 1$.)

Both of the circles have $x=0$.

The origin, $(0,0)$, is on the circumference of $W$.

$k_1$ and $k_2$ should have coordinates of the form $(\pm x,y)$.

Image to explain situation

Answers in JavaScript are preferable but any algorithm will suffice. Thank you very much for any help.

1

There are 1 best solutions below

0
On

$x^2+(y-R)^2=R^2$ and $x^2+(y-br)^2=r^2$.

Thus, $-2Ry=-2bry+b^2r^2-r^2$ or $y=\frac{r^2-b^2r^2}{2(R-br)}$

Can you end?