Let’s assume, hidden in a forest, there’s a beacon. I fly over the forest with a helicopter and, at random intervals, ping the beacon. For each ping I get a lat/lng pair and the signal strength of the beacon at that point (but no direction).
-
How would I compute the location of the beacon in PHP?
-
If, at a later time, I would get another reading, how would I add this to my current estimate of the beacon’s location?
Note: we do not know how the forest is affecting the signal strength, but we can assume the effect is uniform – the beacon could be in a clearing, or buried beneath a stone.
I’m assuming that you’re getting the latitude and longitude of the ping.
You’re going to need a minimum of 4 pings, in a 2 X 2 square grid (as close to this as possible). More pings may help, but you’re going to have to deal with measurement errors.
Here’s a poor Ascii drawing with made up strength values. Assume north is up.
Without doing any math at all, you can determine that the beacon is somewhere to the west north west of the center of where you took these measurements.
If you can calculate a distance by the signal strength (approximately), then you can guess at a spot on a map.
If you can’t calculate the distance, just ping another 2 x 2 square grid where you think the spot might be. At some point, the strengths will be near equal, and you can assume that the beacon is near the center of your square.
I hope this helps and isn’t too time-consuming to do in a helicopter.
Edited to add: The signal strength of a beacon is inversely proportional to the square of the distance.
(distance = sqrt(x factor / signal strength))Let’s assume that you’ve already determined the x factor(12)so you know that a signal strength of 9 represents a circle of 1.1 inches of radius on the map, and that a signal strength of 3 represents a circle of 2.0 inches of radius on the map.So, when you get the ping on the lower left, you can place the ping on the map, and draw a circle with a radius of 1.5 inches. When you get the ping on the upper left, you can place the ping on the map, and draw a circle with a radius of 1.4 inches.
Now, these 2 circles will intersect somewhere on the map. Somewhere in that intersection will be the location of the beacon.
Now the helicopter turns around, and you get the ping in the upper right. You draw a circle with a radius of 1.7 inches. Then you get the ping in the lower right, and you
draw a circle with a radius of 2 inches.
The intersection of the four circles should make up a small rough quadrilateral.
You fly to the center of the quadrilateral, and take another ping. You should get a pretty high signal strength. Rappel down a rope, find the beacon and the stranded hiker, return to the rope, and have the helicopter pull you and the stranded hiker up to safety.