Solution (source code)

= Solution

For a horizontal interface, <Snell law for elastic waves> conserves horizontal <seismic ray parameter> $p=\sin i/V$. At the limestone–sandstone interface the incident P wave has $p=\sin20^\circ/2500$. The reflected S wave remains in the <limestone>, so
$$
\sin r_S=1500p=0.6\sin20^\circ,\qquad \boxed{r_S=11.84^\circ}
$$
from vertical. All angles below use this normal-to-interface convention.