## 3 Digital Star Chart Generation
### GNSS Search and Coordinate Transformation  
The attitude of the vehicle can be represented by quaternions [15] and Euler angles. Due to the high complexity of the FPGA's computing trigonometric functions, this paper uses quaternions to represent the attitude of the vehicle. The algebraic form of quaternion \(q\) is shown in Equation (3) as follows:  
\[q_{0}=q_{1}\overset{\rightarrow}{i}+q_{2}\overset{\rightarrow}{j}+q_{3} \overset{\rightarrow}{k}+q_{4} \tag{3}\]  
where \(q_{1}\), \(q_{2}\), and \(q_{3}\) are vector values of \(q\), and \(q_{4}\) is a scalar value of \(q\). The canonical quaternion has a constraint relationship, as shown in the following Equation (4):  
\[q_{1}{}^{2}+q_{2}{}^{2}+q_{3}{}^{2}+q_{4}{}^{2}=1 \tag{4}\]  
The attitude transformation matrix \(C\) expressed in quaternions is shown in Equation (5) as follows:  
\[C= \begin{bmatrix}1-2q_{2}{}^{2}-2q_{3}{}^{2}&2(q_{1}q_{2}+q_{3}q_{4})&2(q_{1}q _{3}-q_{2}q_{4})\\ 2(q_{1}q_{2}-q_{3}q_{4})&1-2q_{1}{}^{2}-2q_{3}{}^{2}&2(q_{2}q_{3}+q_{1}q_{4}) \\ 2(q_{1}q_{3}+q_{2}q_{4})&2(q_{2}q_{3}-q_{1}q_{4})&1-2q_{1}{}^{2}-2q_{2}{}^{2} \end{bmatrix}  \tag{5}\]  
The z-axis pointing of the attitude transformation matrix is the direction of the optical axis of the star sensor, so the direction vector of the optical axis pointing is obtained in the matrix \( \begin{bmatrix}x_{0}&y_{0}&z_{0}\end{bmatrix} ^{T}\) as shown in the following Equation (6):  
\[ \begin{bmatrix}x_{0}&y_{0}&z_{0}\end{bmatrix} ^{T}= \begin{bmatrix}2(q_{1}q_{3}+q_ {2}q_{4})&2(q_{2}q_{3}-q_{1}q_{4})&-q_{1}{}^{2}-q_{2}{}^{2}+q_{3}{}^{2}+q_{4}{ }^{2}\end{bmatrix} ^{T} \tag{6}\]  
Figure 2: Schematic diagram of the starry sky partition. The expression of the right ascension and declination vector in spatial Cartesian coordinates in the celestial coordinate system is shown in the form of Equation (7) as follows:  
\[ \begin{bmatrix}X&Y&Z\end{bmatrix} ^{T}= \begin{bmatrix}\cos\delta\cos\alpha&\cos \delta\sin\alpha&\sin\delta\end{bmatrix} ^{T} \tag{7}\]  
where \(\alpha\) and \(\delta\) are the values of the right ascension and declination of the star point. Let \( \begin{bmatrix}X_{s}&Y_{s}&Z_{s}\end{bmatrix} ^{T}\) be the spatial Cartesian coordinate direction vector of the star sensor, and the conversion relationship with the direction vector of the star point in the celestial sphere coordinate system is shown in Equation (8) as follows:  
\[ \begin{bmatrix}X_{s}&Y_{s}&Z_{s}\end{bmatrix} =C \begin{bmatrix}X&Y&Z\end{bmatrix} ^ {T} \tag{8}\]  
Let the star sensor optical axis pointing be the right ascension and declination \((\alpha_{0},\delta_{0})\), and the expression can be obtained from Equation (9) as follows:  
\[ \begin{split}\alpha_{0}&=\left\{\begin{array}{l}\arctan\frac{y _{0}}{x_{0}}+2\pi,(x_{0}>0,y_{0}<0)\\ \arctan\frac{y_{0}}{x_{0}},(x_{0}>0,y_{0}\geq 0)\\ \frac{\pi}{2},(x_{0}=0,y_{0}>0)\\ \frac{\pi}{2},(x_{0}=0,y_{0}<0)\\ \arctan\frac{y_{0}}{x_{0}}+\pi,(x_{0}<0)\end{array}\\ \delta_{0}&=\arcsin_{2}0\end{split}  \tag{9}\]  
The star area zone filtering can improve the speed of the navigation star search according to the optical axis of the star sensor to point to the target subzone range within the search range, which is sufficient. The left (\(J_{l}\)) and right (\(J_{r}\)) boundaries of the star area subarea numbers are calculated as shown in the following Equation (10):  
\[ \begin{split} J_{l}&=\text{int}\bigg{(}\frac{\alpha- \left(\frac{\beta}{2}\right)/cos\delta-180^{\circ}}{B}+\frac{M}{2}\bigg{)}\\ J_{r}&=\text{int}\bigg{(}\frac{\alpha+\left(\frac{\beta}{2} \right)/cos\delta-180^{\circ}}{B}+\frac{M}{2}\bigg{)}\end{split}  \tag{10}\]  
If \(J\) is not in the interval 0 to 29, it is added or subtracted by continuously adding or subtracting 30 until \(J\) falls within the interval 0 to 29. The upper (\(D_{u}\)) and lower (\(D_{d}\)) bounds of the star area sub-area numbering are calculated [16] as shown in the following Equation (11):  
\[