# An Interactive System Based on the IASP91 Earth Model for Earthquake Data Processing
## 3 Major Functions  
### Data Rotation  
The place within the Earth where the rupture of a rock formation causes vibrations is called the seismic source. It is an area of a certain size, also known as the epicenter zone or source body, where the energy of an earthquake is accumulated and released. The vertical projection of the source on the Earth's surface is the epicenter, and the distance in an arc between the epicenter and the observation point is the epicenter distance. The azimuth (\(\alpha\)) is the clockwise angle between the longitude line where the epicenter is located and the large circular arc pointing from the epicenter to the station (as shown in Figure 1), and the inverse azimuth (\(\beta\)) is the clockwise angle between the longitude line where the station is located and the large circular arc pointing from the station to the epicenter. Supposing the longitude and latitude coordinates of the epicenter are (\(\varphi_{s}\), \(\psi_{s}\)) and the longitude and latitude coordinates of the observation station are (\(\varphi_{E}\), \(\psi_{E}\)), the location of the epicenter and the observation station of the earthquake in Cartesian coordinates can be expressed as  
\[X= \begin{pmatrix}x_{1}\\ x_{2}\\ x_{3}\end{pmatrix} = \begin{pmatrix}Rcos\varphi cos\psi\\ Rsin\varphi cos\psi\\ Rsin\psi\end{pmatrix}  \tag{1}\]  
\[ \begin{cases}X_{E}=(Rcos\varphi_{E}cos\psi_{E},Rsin\varphi_{E}cos\psi_{E},Rsin \psi_{E})\\ X_{S}=(Rcos\varphi_{S}cos\psi_{S},Rsin\varphi_{S}cos\psi_{S},Rsin\psi_{S})\\ \end{cases}  \tag{2}\]  
In addition, if the angle between \(X_{E}\) and \(X_{s}\) is \(\theta\), then  
\[X_{E}\cdot X_{s}=R^{2}cos\theta \tag{3}\]  
\[\theta=cos^{-1}[cos\psi_{E}cos\psi_{S}(cos(\varnothing_{S}-\varnothing_{E})+ sin\psi_{E}+sin\psi_{S})] \tag{4}\]  
To calculate the azimuth and inverse azimuth of an observation station relative to the epicenter of an earthquake, we construct a unit vector in the ground plane where the epicenter of the earthquake is located, and make  
\[X_{E}\times X_{s}=\mathbf{b}R^{2}sin\theta \tag{5}\]  
So  
\[\mathbf{b}=\frac{1}{sin\theta} \begin{pmatrix}sin\varnothing_{S}cos\psi_{S}sin\psi _{E}-sin\varnothing_{E}cos\psi_{E}sin\psi_{S}\\ cos\varnothing_{S}sin\psi_{S}cos\psi_{E}-cos\varnothing_{E}sin\psi_{E}cos\psi_{S }\\ cos\psi_{S}cos\psi_{E}sin(\varnothing_{E}-\varnothing_{S})\\ \end{pmatrix}  \tag{6}\]  
The vector \(b\) is perpendicular to the ray plane and lies in the same plane (ground plane) as the vector bases \(e_{\varnothing}\) and \(e_{\psi}\) of the spherical coordinates, and thus the azimuth \(\alpha\) of  
Figure 1: Diagram of azimuthal correction. the station relative to the epicenter of the earthquake is the angle between the vector \(b\) and \(e_{\varnothing}\), which gives  
\[cos\alpha=\mathbf{b}\cdot\mathbf{e}_{\varnothing}=\frac{sin\psi_{S}cos\psi_{E}-cos\psi_ {S}sin\psi_{E}\cos(\varnothing_{S}-\varnothing_{E})}{sin\theta} \tag{7}\]  
Or  
\[sin\alpha=\mathbf{b}\cdot\mathbf{e}_{\varphi}=\frac{cos\psi_{S}sin(\varnothing_{S}- \varnothing_{E})}{cos\theta} \tag{8}\]  
The formula for the inverse azimuth can be obtained by simply swapping the subscripts for the longitude and latitude of the earthquake epicenter and the observatory station, i.e.,  
\[cos\beta=\frac{sin\psi_{E}cos\psi_{S}-cos\psi_{E}sin\psi_{S}\cos(\varnothing_ {E}-\varnothing_{S})}{sin\theta} \tag{9}\]  
The three components \(Z(t)\), \(N(t)\) and \(E(t)\) of the observed seismic record represent, in turn, the vertical component (VZ) record, the north-south component (NS) record and the east-west component (EW) record. In research work on seismic data (e.g., reception functions, transverse wave splitting, etc. ), the two components \(R(t)\) and \(T(t)\) represent the two horizontal components of the seismic record obtained after rotation of the radial component (SV wave) and the tangential component (SH wave).