Three seismometers recorded a local earthquake. You will turn their S minus P lags into distances, and find the epicentre that fits all three.
The idea. Each lag gives a distance . The epicentre is the point whose distances to the three stations match the three values as well as possible. A search over a grid of points finds it.
Your tasks.
distance, return the distance in km from the lag, with and .misfit, return the sum, over the three stations, of the squared difference between the distance from the point to the station and the distance from its lag.locate, return the grid point , in steps of , with the smallest misfit.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…