Earthquake waves travel along ray paths that bend at velocity contrasts. For a crust of thickness h and P speed V1 over a faster mantle V2 (the Moho), a surface station at distance x first records either the direct wave t = x / V1 or the head wave refracted along the Moho t = x / V2 + 2 h sqrt(1 - V1^2/V2^2) / V1. The branches cross at x_c = 2 h sqrt((V2 + V1)/(V2 - V1)); the slope of the far branch gives V2 and its intercept gives h, which is how the Moho was discovered. The head wave only exists beyond the critical angle sin(theta_c) = V1/V2.
S waves are shear waves and travel slower, Vs = Vp / sqrt(3) for a Poisson solid; the S-P delay grows with distance, which is how epicentre distance is estimated.
The wavefronts come from a first-order fast-sweeping eikonal solver (|grad T| = 1/V) on a 0.5 km grid, an independent numerical method whose station arrival times the check compares with the closed formulas. Simplifications: two homogeneous layers, flat boundary, source at the surface, no amplitudes or reflections, vertical axis exaggerated in the drawing.