I am working on a triangulation algorithm to be used with an 8-bit microcontroller using UWB RFID. I will have two unknowns $x$ and $y$ for the item I am tracking, but I need to use three equations to solve it since only using two will give two solutions.
These are the equations:
$$(x-a_{0x})^{2} + (y-a_{0y})^{2} = d_{0}^{2}\\ (x-a_{1x})^{2} + (y-a_{1y})^{2} = d_{1}^{2}\\ (x-a_{2x})^{2} + (y-a_{2y})^{2} = d_{2}^{2}$$
Here $a_{nx}$, $a_{ny}$ and $d_n$ are known.
I have two issues. First, since this will be using RFID, the values that I will use will not give an "exact" value, so the method used to solve this will need to be an approximation.
Second, since this is on an 8-bit processor, I need to use the most efficient method possible to solve this equation set.
Could I have some suggestions on what numerical solving algorithms I should try?
Thanks
EDIT:
So for example, if I have this set of equations as the "true" set: $$(x--6)^{2} + (y-9)^{2} = 25\\ (x-6)^{2} + (y-9)^{2} = 73\\ (x)^{2} + (y)^{2} = 40$$ The exact value of $(x,y)$ is $(-2,6)$.
But since the know values are gathered from my RFID chip, they will never be "exact" and instead, I could have an equation set like:
$$(x--6.01)^{2} + (y-9.6)^{2} = 25.5\\ (x-6.05)^{2} + (y-9)^{2} = 72.8\\ (x)^{2} + (y)^{2} = 40.5$$
So the solving algorithm needs to be able to give a best approximation for the equation. Maybe using ordinary squares?
The difference of any pair of the circle equations is the equation of a line that passes through their intersection points. If the measurements are exact, these three lines are coincident, in which case the common intersection of the three circles can be found by computing the intersection of any two of them. It turns out that in the presence of noise these lines remain coincident, so their intersection can be used as a fairly quick and dirty estimate of the true intersection.
The equation of the line through the intersection points of circles $i$ and $j$ is $$2(a_{ix}-a_{jx})x+2(a_{iy}-a_{jy})y+(d_i^2-a_{ix}^2-a_{iy}^2)-(d_j^2-a_{jx}^2-a_{jy}^2) = 0,$$ or in homogeneous vector notation, $$\begin{align} \mathbf l_{ij} &= [2(a_{ix}-a_{jx}):2(a_{iy}-a_{jy}):(d_i^2-a_{ix}^2-a_{iy}^2)-(d_j^2-a_{jx}^2-a_{jy}^2)] \\ &= [2a_{ix}:2a_{iy}:d_i^2-a_{ix}^2-a_{iy}^2] - [2a_{jx}:2a_{jy}:d_j^2-a_{jx}^2-a_{jy}^2] \\ &= \mathbf m_i - \mathbf m_j. \end{align}$$ The intersection of lines $\mathbf l_{ij}$ and $\mathbf l_{jk}$ is $$\begin{align} \mathbf l_{ij} \times \mathbf l_{jk} &= (\mathbf m_i - \mathbf m_j)\times(\mathbf m_j-\mathbf m_k) \\ &= (\mathbf m_i\times\mathbf m_j)+(\mathbf m_j\times\mathbf m_k)+(\mathbf m_k\times\mathbf m_j). \end{align}$$ It’s not hard to see that the three pairwise intersections yield the same point. To dehomogenize, divide through by the last component of its homogeneous coordinates.
Applying this to your perturbed example produces $$\begin{align} \mathbf m_0 &= [-12.02 : 19.2 : -102.7801] \\ \mathbf m_1 &= [12.1 : 18 : -44.8025] \\ \mathbf m_2 &= [0 : 0 : 40.5] \end{align}$$ and $$(\mathbf m_0\times\mathbf m_1)+(\mathbf m_1\times\mathbf m_2)+(\mathbf m_2\times\mathbf m_0) = [941.2338 : -2759.02526 : -448.68],$$ which dehomogenizes to $(-2.09778, 6.1492)$, which is pretty close to the result in other answers.