When you toss a pebble into a pond, it creates radiating waves in the water. An earthquake does the same thing with energy. When the plates fracture or slip, energy is released as seismic waves [source: USGS].
There are several types of seismic waves. Body waves move through the inside of the Earth. There are two types of body waves:
Primary waves (or P waves) are the fastest moving waves, traveling at 1 to 5 miles per second (1.6 to 8 kilometers per second). They can pass through solids, liquids and gases easily. As they travel through rock, the waves move tiny rock particles back and forth -- pushing them apart and then back together -- in line with the direction the wave is traveling. These waves typically arrive at the surface as an abrupt thud.
Secondary waves (also called shear waves, or S waves) are another type of body wave. They move a little more slowly than P waves, and can only pass through solids. As S waves move, they displace rock particles outward, pushing them perpendicular to the path of the waves. This results in the first period of rolling associated with earthquakes. Unlike P waves, S waves don't move straight through the Earth. They only travel through solid material, and so are stopped at the liquid layer in the Earth's core.
Unlike body waves, surface waves (also known as long waves, or simply L waves) move along the surface of the Earth. Surface waves are to blame for most of an earthquake's carnage. They move up and down the surface of the Earth, rocking the foundations of man-made structures. Surface waves are the slowest moving of all waves, which means they arrive the last. So the most intense shaking usually comes at the end of an earthquake.
How do scientists calculate the origin of an earthquake by detecting these different waves?