Explore the principles of structural dynamics and earthquake engineering, elucidating the methods used to analyze the dynamic response of structures to seismic loading and the strategies for mitigating earthquake-induced risks through design and retrofitting measures?