Working on a project and this problem came up.
Trying to find a general form for $r_q$ and $\theta _q$ from these two simultanous equations. I'm think that there will be many cases (almost all of them) where a solution doesn't exist but I am hoping that there will still be a general form that will just have undefined or complex results.
The first is $L_a = \sqrt{r_a^2 + r_q^2 - 2r_ar_q\cos(\theta_a - \theta_q)}$
The second is $L_b = \sqrt{r_b^2 + r_q^2 - 2r_br_q\cos(\theta_b - \theta_q)}$
I have tried to solve this on my own but its been years since I've done any maths and I unfortunately can't take the time to relearn all I've forgotten to figure this out.
What I am trying to do is find the points where a point $Q$ is a set distance, $L_a$, from a known point $A$ and a set distance, $L_b$, away from another known point $B$.
I got these equations by looking for an equation for the distance between two points using Polar coordinates. The problem is that I need this to work inside a piece of software I am writing so I can't just plug in the numbers and solve it manually every time which is why I was hoping for a way of finding $r_q$ and $\theta_q$ in general forms that I can then use within the software.
Also in terms of what I've tried to do I didn't try to use any of the advanced techniques I was taught back when I was a maths student as I haven't looked at any of them in years so I spent about half an hour trying to combine them or rearrange them with basic algebra before giving up and coming here.
N.B. I am not trying to use this in any kind of commercial software it is for a personal project for a tabletop game.
Finding point $Q$ at given distances $L_a,L_b$ from 2 fixed points $A(x_A,y_A), B(x_B,y_B)$ resp. is like finding the intersecting points of the circles with centers $A$ and $B$ and radii $L_a,L_b$ resp.
Please note that I refer to cartesian coordinates with:
$$x_A=r_a \cos \theta_a, y_A=r_a \sin \theta_a, etc.$$
Therefore, we have to solve, i.e., find solution(s) $(x,y)$ (which will be the cartesian coordinates of $Q_k$) to the system of equations:
$$\begin{cases}(x-x_A)^2+(y-y_A)^2&=&L_a^2 & \ \ Eq.(1) \ \text{of the first circle}\\ (x-x_B)^2+(y-y_B)^2&=&L_b^2 & \ \ Eq.(2) \ \text{of the 2nd circle} \end{cases}$$
which is equivalent to the system where (Eq. 1) is kept as it is and (Eq. 2) is replaced by the equation obtained as the difference between Eq. (1) and Eq. (2) (this is in fact the equation of line $Q_1Q_2$, called the "radical axis" of the 2 circles):
$$\begin{cases}(x-x_A)^2+(y-y_A)^2&=&L_a^2 & \ \ Eq.(1)\\ 2(x_A-x_B)x+2(y_A-y_B)y+\underbrace{(x_B^2+y_B^2)}_{r_B^2}-\underbrace{(x_A^2+y_A^2)}_{r_A^2}&=&L_b^2 -L_a^2& \ \ Eq.(2')\\ \end{cases}$$
Extracting $y$ from Eq. (2') will give you a first degree expression in variable $x$, say
$$y=ux+v \tag{3}$$
that you will plug into into Eq. (1), getting in this way a quadratic equation in $x$ that will give you 2 solutions $x_1,x_2$. Plugging each one in (3), you will get the associated $y_1,y_2$. In this way the two possible points are $Q_1(x_1,y_1)$ and $Q_2(x_2,y_2).$
It will remain to switch back, if necessary, to polar coordinates