# An Efficient GNSS Coordinate Recognition Algorithm for Epidemic Management
## 3 System Architecture and Problem Description
The numbers of intersections of \(\mathit{ray}(g_{1})\) and the edges of \(P\) and those of \(\mathit{ray}(g_{1})\) and the edges of \(P\), respectively, are two and zero; both numbers are even. This means that point \(g_{1}\) and point \(g_{2}\) are both outer points of \(P\). There are three different polygons (\(S_{0}\), \(S_{1}\), and \(S_{2}\)). The entire space of \(S_{0}\) is a subspace of \(P\), so \(S_{0}\) is an inner polygon of \(P\). A certain part of the space (not all of the space) of \(S1\) is part of the space of \(P\), so \(S_{1}\) is a polygon intersecting with \(P\). No space of \(S_{2}\) is part of the space of \(P\), so \(S_{2}\) is an outer polygon of \(P\). In order to determine a polygon's architecture with point and space statuses, the calculation of the intersections of segments is necessary. It is necessary to calculate whether two segments have an intersection or not. In [29], a computer-friendly method was proposed. Suppose that there are two lines. The first line crosses over both point \(ga\) and point \(gb\). The other line crosses over both point \(gc\) and point \(gd\). First, as shown in (1), \(\alpha\) can be evaluated. \[\alpha=(g_{a.x}-g_{b.x})\times(g_{c.y}-g_{d.y})-(g_{a.y}-g_{b.y})\times(g_{c. x}-g_{d.x}). \tag{1}\]  
Figure 1: System architecture. Each target has a mobile device with a GNSS receiver. The mobile device can receive GNSS signals, convert them into coordinate data, and send the data to database-based storage. A computer performs the operation of coordinate recognition with the input of a geographical area \(P\) and can obtain the targets in the area \(P\). If the value of \(\alpha\) is 0, the two lines are parallel. Otherwise, there is an intersection between the two lines. Next, \(\kappa_{1}\) and \(\kappa_{2}\) can be evaluated as in (2) and (3), respectively. \[\kappa_{1}=((g_{a.x}-g_{c.x})\times(g_{c.y}-g_{d.y})-(g_{a.y}-g_{c.y})\times(g_{ c.x}-g_{d.x}))/\alpha \tag{2}\]  
\[\kappa_{2}=((g_{a.x}-g_{b.x})\times(g_{a.y}-g_{c.y})-(g_{a.y}-g_{b.y})\times(g_{ a.x}-g_{b.x}))/\alpha \tag{3}\]  
If the value of \(\kappa_{1}\) is between 0 and 1, the intersection is between \(g_{a}\) and \(g_{b}\). If the value of \(\kappa_{2}\) is between 0 and 1, the intersection is between \(g_{c}\) and \(g_{d}\). In other words, if segment \((g_{a},g_{b})\) and segment \((g_{c},g_{d})\) intersect, the value of \(\kappa_{1}\) is between 0 and 1, and the value of \(\kappa_{2}\) is between 0 and 1. Figure 3 provides examples of lines (or segments) with intersections. There are three lines (\(l_{1}\), \(l_{2}\), and \(l_{3}\)). Line \(l_{1}\) passes through points (1, 3) and (4, 3). Line \(l_{2}\) passes through points (1, 1) and (4, 1). Line \(l_{3}\) passes through points (3, 4) and (2, 3). In lines \(l_{1}\) and \(l_{2}\), \(\alpha\) is 0, which means that the two lines are parallel. In lines \(l_{2}\) and \(l_{3}\), \(\alpha\) is \(-6\), \(\kappa_{1}\) is 0.17, and \(\kappa_{2}\) is 1.5, which means that the intersection is between (1, 1) and (4, 1). In lines \(l_{1}\) and \(l_{3}\), \(\alpha\) is \(-6\), \(\kappa_{1}\) is 0.5, and \(\kappa_{2}\) is 0.5, which means that the intersection is between (1, 3) and (4, 3), and there is also an intersection between (2, 2) and (3, 4). Assume that \(G\) is the set of all geographical points. All points in G are stored in a database and can be retrieved with Structured Query Language (SQL) by using a database management system [27; 28]. In this study, MySQL [30], an open-source relational data-stream management system, was applied.