Hey there!
Scientists know that seismic waves can be either compressional or transverse because there are horizontal and vertical movements during an earthquake. Horizontal movements are compressional while vertical movements are transverse.
Thank you!