# Towards Moving Objects Behavior Analysis: Region Speed Limit Rate Measure
## 2 Definitions and Methods
Thus, given a segment \(s=\) \(<\)(\(x_{j},y_{j}\), \(t_{j}\)), (\(x_{j+1},y_{j+1}\), \(t_{j+1}\)),..., (\(x_{j+m},y_{j+m}\), \(t_{j+m}\))\(>\) then:  
\[\text{segmentDistance}(s)=\sum_{k=j}^{j+m-1}EuclideanDistance((x_{k},\ y_{k}), \ (x_{k}+1,\ y_{k}+1)) \tag{2}\]  
where \(\text{EuclideanDistance}((x_{k},y_{k}),(x_{k+1},y_{k+1}))=\text{SQRT}((x_{k+1}- x_{k})^{2}+(y_{k+1}-y_{k})^{2})\)  
Note that in Equation (1), the numerator corresponds to the total distance of all the maximal slow segments and the denominator corresponds to the total distance of all the maximal segments. Example:  
Consider Figure 6, where we show a cell of side \(l=7\) km of a spatiotemporal scenario, three trajectories corresponding to three vehicles, and _TempSeg_ = [15 June 2022 13:30:00, 15 June 2022 13:35:00). For simplicity, we use a Cartesian coordinate system. If coordinates are in a different coordinate system, e.g., GNSS (global navigation satellite systems) coordinates, a transformation is required, as we have explained in our experiments. \begin{table}
\begin{tabular}{l c} \hline \hline
**Conditions** \\ (a) guarantees the spatial inclusion of all the CPs of a segment in the cell \(R[v,w]\). (b) guarantees the temporal inclusion of all the CPs of a segment in the temporal segment associated with the cell \(R[v,w]\). (c) and (d) guarantee that the segment is the one with the maximum size with respect to conditions (a) and (b). (e) guarantees that the speed among all the consecutive CPs of a segment is less than _MaxSpeed_. (f) and (g) guarantee that the segment has the maximum number of CPs with respect to conditions (a), (b), and (e). \\ \hline \multicolumn{2}{c}{**Segment Type**} & **Conditions** \\ \hline _Segment_ & (a) and (b) \\ \hline _Maximal segment_ & (a), (b), (c), and (d) \\ \hline _Slow segment_ & (a), (b), and (e) \\ \hline _Maximal slow segment_ & (a), (b), (e), (f), and (g) \\ \hline \hline \end{tabular} Note that a _slow segment_ may, in turn, be a _maximal segment_; it occurs when it also meets conditions (c) and (d) or equivalently when a maximal segment also meets conditions (e), (f), and (g).  
\end{table} 
Table 1: Summary of segment types in a cell (\(R[v,w]\)). From Figure 6, we have:  
_MaxSeg = \(\{ms_{1}\), \(ms_{2}\), \(ms_{3}\}\)_ = {  
<(1, 5, 15 June 2022 13:30:00), (2, 5, 15 June 2022 13:31:00), (2, 7, 15 June 2022 13:32:00)>,  
<(2, 3, 15 June 2022 13:31:00), (4, 3, 15 June 2022 13:32:00), (6, 3, 15 June 2022 13:33:00)>,  
<(5, 1, 15 June 2022 13:32:00), (6, 1, 15 June 2022 13:33:00), (7, 1, 15 June 2022 13:34:00)> }  
Note that in \(ms_{2}\), we do not include the point (7, 3) because we do not have the time when it was generated, i.e., it is an incomplete CP (in future work, its time may be interpolated). Thus:  
segmentDistance(\(ms_{1}\)) = 1 + 2 = 3 km  
segmentDistance(\(ms_{2}\)) = 2 + 2 = 4 km  
segmentDistance(\(ms_{3}\)) = 1 + 1 = 2 km  
Then, the total distance of all the maximal segments is 3 + 4 + 2 = 9 km (denominator in Equation (1)). _MaxSlowSeg = \(\{ms_{1}\), \(ms_{2}\}\)_ = {  
<(1, 5, 15 June 2022 13:30:00), (2, 5, 15 June 2022 13:31:00)>,  
<(5, 1, 15 June 2022 13:32:00), (6, 1, 15 June 2022 13:33:00), (7, 1, 15 June 2022 13:34:00)> }  
For example, the segment \(ms_{1}\) is a _maximal slow segment_ because the speed between its two CPs is:  
EuclideanDistance((1, 5), (2, 5)) = SQRT((2 - 1)2 + (5 - 5)2) = 1 km. Time between the two CPs = 1 min. Thus, speed = 1 km/min = 60 km/h, and because _MaxSpeed_ = 80 km/h, then, 60 km/h \(\leq\) 80 km/h. Note that the speed between (2, 5, 15 June 2022 13:31:00) and (2, 7, 15 June 2022 13:32:00) is 2 km/min = 120 km/h and 120 km/h > 80 km/h. Thus:  
segmentDistance(\(ms_{1}\)) = 1 km. segmentDistance(\(ms_{2}\)) = 1 + 1 = 2 km. Figure 6: A cell with three trajectories. Then, the total distance of all the maximal slow segments is \(1+2=3\) km (numerator in Equation (1)). Therefore:  
Speed limit rate = \(3/9=0.333\). The CellSpeedLimitRate algorithm finds the speed limit rate of a cell of a spatiotemporal scenario.