Hacker News new | ask | show | jobs
by xnx 874 days ago
Nice work. I feel like there must be some way to triangulate the sound source through direct calculation, but that trigonometry is too advanced for me.
3 comments

If you want to avoid doing the maths I think you can draw the problem out (assuming the world is a flat piece of paper and the source is located on the same piece of paper with you)

From the timings given you can work out the distance from location B and C to the wavefront when it hits point A (4 x 330 and 6 x 330). If you then draw a circle centered at point B with radius 1320m, and a circle centered C with radius 1980m, then there is only one circle you can draw that intersects point A, and is tangent with the circles drawn at B and C. The center of that circle is the source (with an appropriate radius of error for timing measurement and distance measurement between A, B, and C)

https://imgur.com/a/tqV0ToU

Epic comment and diagram, thanks. From this, how can we calculate bearing and distance from one of our locations to the source? Edit: I see that we can use multilateration suggested by parent-sibling comment if we just had distance to source (ie radius of unique tangent circle).
ChatGPT tipped me off that it's called multilateration and provided the formulas. I Google search turned up this Python code: https://github.com/glucee/Multilateration
This is not the same problem. We don't have the distance to the source, only the difference in arrival times.
"multilateration (MLAT) ... is a technique for determining the position of an unknown point, such as a vehicle, based on measurement of the times of arrival (TOAs) of energy waves traveling between the unknown point and multiple stations at known locations."

https://en.wikipedia.org/wiki/Pseudo-range_multilateration

Definitely what I would have tried to do. Likely would have taken me longer than the approach the OP took.