Welcome to Project Lovelace! We're still super new so there are still tons of bugs to find and improvements to make. If you have any suggestions, complaints, or any comments at all please let us know on Discourse!

Finding earthquake epicenters

You will learn about:
equation of a circle, systems of linear equations.

To figure out how far away an earthquake is you just need one seismograph but to pinpoint where the earthquake happened, it's epicenter, you need three seismographs in three different locations.
Say an earthquake occurs at some unknown location $(x_0,y_0)$ on a 2D plane. It will emit seismic waves which travel through the Earth and are detected by seismograph stations. More than one type of wave is emitted but we'll just consider the faster compressional P-waves which travel at around $v = 6 \; \text{km/s}$ and arrive at the seismographs first.

Given the position of three seismographs $(x_i,y_i)$ and arrival time of the seismic waves at each seismograph $t_i$ where $i=1,2,3$ as inputs, determine and return the earthquake's epicenter $(x_0,y_0)$.

Input:
$(x_i,y_i)$ in kilometers where $-100 < x,y < 100$ and $t_i$ in seconds for $i=1,2,3$.

Output:
The earthquake's epicenter $(x_0,y_0)$ in kilometers.

Write a function that accepts the input as function parameters and returns the correct output. Make sure to read the description above to produce the correct output in the correct format and use the correct function signature so we can run your code. A good first step is to try reproducing the example(s). Your code must not take longer than the maximum runtime to run and must not use more memory than the allowed limit.

You must be logged in to view your submissions.

Notes

The whole process of using points, distances, and circles to determine the location of another point (in our case the earthquake) is called trilateration.

Earthquakes usually happen below the surface so technically the epicenter is the location on the Earth's surface below which the earthquake occured while the earthquake's focus is where it actually happened inside the Earth.

We're also assuming that the earthquake happens very close to the surface and that the seismographs are close to each other so the Earth's curvature is negligible. When the seismographs are far apart which is typical for earthquakes that happen below the ocean or when the earthquake happens deep below the ground, the Earth's spherical shape matters a lot.

The actual velocity of the P-waves can vary quite a bit depending on the medium it's traveling through. We picked a typical value of 6 km/s which is roughly the velocity of a P-wave at the Earth's surface.

Let us know what you think about this problem! Was it too hard? Difficult to understand? Also feel free to discuss the problem, ask questions, and post cool stuff on Discourse. You should be able view the discussion thread below. Feel free to post your solutions but please do your best to organize and document your code well so others can learn from it.