Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Solving 3 equations


Solving 3 equations

Hello there, clever people!

I'm doing a project at the moment, and I am trying to program a microcontroller to tell me, by using three microphones, where a sound originated.
To do this I will use the formula for a circle (The soundwave), where vs is the speed of sound, and delta tab/tac is the difference in time from mic a to b and a to c.
This is lovely.. It's not a horrible problem to calculate this using Mathcad (God bless), and with the following example:


And that was actually the origin of the sound.
Now, I need do develop an algorithm that does all this for me - so I need to know how to solve this by hand. And I must admit; my brain has shorted out. I really, really forgot and it is kind of akward.. 🙂

By using the above listed values, i came down to these equations:


and we can see, that they actually give the same origin of the sound.
Now - my big question is: How do you solve the three equations above, only by hand

I am very sorry, to be asking a question this basic - but I really don't know.
I hope you can help me, so all the crying can stop 😉

Thank you,


The problem is by no means basic.

See attached the symbolic solution done by Mathcad - its huge. Not sure if it can be made more handy by using a different coordinates system or some sort of parameter representation.

In cartesian coordinates we get two sets of solutions - I guess one of them will have a negative radius r and will have to be discarded. Using "assume, ALL=real, r>0, Deltab>0, Deltac>0" with the symbolic "solve" was no success, though, so you would have to sort it out yourself.

EDIT: Exchanged the file for a somewhat better version.

That's so thoughtfull of you! I really thought, that I just forgot everything from highschool 🙂
This is really going to make me study this a bit more - thank you so much for your help - it is much appericiated!

You are welcome. The symbolic output isn't inviting.

As your problem seems to be smilar to GPS position locating (just in 2D), you may find some clever algorithms if you search in this direction - not sure, of course.

You may also search for TDOA (Time Difference of Arrival) or the like. A quick search showed that there exist many different approaches to sound localization, many of them would use some kind of approximation and/or implement an iteration algorithm to solve a system of equations. There are even methods to localize the sound without knowing the exact postion of the microphones (you will need more than 3, as far as I understood from a quick glance).

But of course you are free to implement the exact solution shown in my sheet and you just would have to decide which of the two solutions you have to take. If you do that, beware of the typos 😉

Top Tags