For an embedded systems project, I need to solve a system of equations. However, my algebraic skills are limited, and I am not able to solve it.
This question consists of the following parts.
- The math
- Tried methods
- Context
The system
The system is as follows.
$x^2 + y^2 + z^2 = r^2$
$i/i_1 = (x-x_1)^2 + (y-y_1)^2 + (z-z_1)^2$
$i/i_2 = (x-x_2)^2 + (y-y_2)^2 + (z-z_2)^2$
$i/i_3 = (x-x_3)^2 + (y-y_3)^2 + (z-z_3)^2$
I want to solve this for $i$, $x$, $y$, and $z$, so I get four formulas. The other variables, $r$, $i_1$, $i_2$, $i_3$, $x_1$, $x_2$, $x_3$, $y_1$, $y_2$, $y_3$, $z_1$, $z_2$, and $z_3$ are known when the formulas are needed, but are not constant.
Is this possible, and if so, how do I it?
Tried methods
First, I seperated x, from the second equation, and substituted the result in the other equations.
$x = \sqrt{i/i_1 - (y-y_1)^2 - (z-z_1)^2} + x_1$
As you see, this gets ugly very fast, so I think this is not the right way to do it.
Another method I tried was subtracting the equations from each other, but this did not lead to anything useful.
I gave everything to Wolframalpha, but it took too long, and required Wolframalpha pro to get more processing time, which I do not have.
My friends could not help me, or had no time, or are busy helping at the moment. Friends of friends did not very well. I guess facebook is not always the best option.
I searched Stackexchange using solve system of quadratic equations, and I found some questions. However, these did not give my enough insight to solve my own problem.
Context
The project I am working on, is about locating an object in three dimensional space. I do this by connecting three LDRs, which react to light, to an Arduino microcontroller. This controller is then connected to my computer, where I do the actual calculations, and simulate everything in a 3D scene. When I take my flashlight and shine light, I use the values from the LDRs, together with the assumption that the flashlight is at a fixed distance from the center of the LDRs, to approximate the location of the flashlight.
$, which was pretty much the first thing this guide said, but okay. – Aart Stuurman Jan 22 '15 at 11:27