# Towards Moving Objects Behavior Analysis: Region Speed Limit Rate Measure
## 2 Definitions and Methods
Figure 3: Segment of a trajectory T in a cell of a spatiotemporal scenario. Figure 2: Spatial segmentation: region of interest segmented into cells (array of order \(3\times 4\)). * The last CP, i.e., (\(\chi_{j+m}\), \(y_{j+m}\), \(t_{j+m}\)), of \(Subt\) is the last CP of \(T\) (i.e., \(j+m=n\)), or if \(j+m<n\) then: (\(x_{j+m+1}\), \(y_{j+m+1}\)) is not inside \(R[v,w]\) or \(t_{j+m+1}\
otin TempSeg\). In this way, conditions (c) and (d) guarantee that \(Subt\) is the segment of the maximum size with respect to conditions (a) and (b). Figure 4 illustrates a maximal segment of \(T\) in a cell of a spatiotemporal scenario. On the other hand, let \(Subt=\) (\(x_{j}\), \(y_{j}\), \(t_{j}\)), (\(x_{j+1}\), \(y_{j+1}\), \(t_{j+1}\)),..., (\(x_{j+m}\), \(y_{j+m}\), \(t_{j+m}\)) \(>\) a segment of \(T\) in \(R[v,w]\). We say that \(Subt\) is a _slow segment_ in \(R[v,w]\) if, in addition to conditions (a) and (b), it meets the following:  
* Let \(MaxSpeed\) be a speed limit set by the analyst, where \(MaxSpeed\in\mathbb{R}^{+}\), then \(\forall\) (\(x_{k}\), \(y_{k}\), \(t_{k}\)) and (\(x_{k+1}\), \(y_{k+1}\), \(t_{k+1}\)), \(k\in 1^{*}\), \(j\leq k<(j+m)\), i.e., for every pair of consecutive CPs in \(Subt\), their speed (calculated as the distance of the straight line between (\(x_{k}\), \(y_{k}\)) and (\(x_{k+1}\), \(y_{k+1}\)) divided by (\(t_{k+1}\)-\(t_{k}\))) is less than or equal to \(MaxSpeed\). Moreover, a slow segment is _maximal_ if it meets the following:
* The first CP of \(Subt\), i.e., (\(x_{j}\), \(y_{j}\), \(t_{j}\)), is the first CP of \(T\) (i.e., \(j=1\)), or if \(j>1\) then, the speed between (\(x_{j-1}\), \(y_{j-1}\), \(t_{j-1}\)) and (\(x_{j}\), \(y_{j}\), \(t_{j}\)) is greater than \(MaxSpeed\), or (\(x_{j-1}\), \(y_{j-1}\)) is not inside \(R[v,w]\), or \(t_{k}\
otin TempSeg\). * The last CP of \(Subt\), i.e., (\(x_{j+m}\), \(y_{j+m}\), \(t_{j+m}\)), is the last CP of \(T\)(i.e., \(j+m=n\)), or if \(j+m<n\) then, the speed between (\(x_{j+m}\), \(y_{j+m}\), \(t_{j+m}\)) and (\(x_{j+m+1}\), \(y_{j+m+1}\), \(t_{j+m+1}\)) is greater than \(MaxSpeed\), or (\(x_{j+m+1}\), \(y_{j+m+1}\)) is not inside \(R[v,w]\) or \(t_{j+m+1}\
otin TempSeg\). Informally, condition (e) guarantees that the speed among all the consecutive CPs of a slow segment is less than the given speed limit (\(MaxSpeed\)). Meanwhile, conditions (f) and (g) guarantee that a slow segment has the maximum cardinality (i.e., the number of CPs) with respect to conditions (a), (b), and (e). Figure 5 shows a trajectory with two _maximal slow segments_ in a cell of a spatiotemporal scenario. Figure 4: Maximal segment of a trajectory T in a cell of a spatiotemporal scenario. Figure 5: Trajectory with two maximal slow segments in a cell of a spatiotemporal scenario. In Table 1 we summarize our segment types in a cell (\(R[v,w]\)) and the conditions that each must meet. **Speed limit rate in a cell of a spatiotemporal scenario:** Let \(R[v,w]\) be a cell of a spatiotemporal scenario \(STS(R,\)_TempSeg_) where \(R\) is a region of order \(p\times q\), \(0<v\leq p\); \(0<w\leq q\), \(v\), \(w\in\Gamma^{+}\), \(MaxSlowSeg=\{mss_{1}\), \(mss_{2}\),..., \(mss_{p}\}\) the set of all the _maximal slow segments_ of all the trajectories that passed through \(R[v,w]\), and \(MaxSeg=\{ms_{1}\), \(ms_{2}\),..., \(ms_{k}\}\) the set of all the _maximal segments_ of all the trajectories that passed through \(R[v,w]\). The _speed limit rate_ of \(R[v,w]\) is given by Equation (1). \[\text{Speed limit rate}=\frac{\sum_{i=0}^{p}segmentDistance(mss_{i}),mss_{i} \in\ MaxSlowSeg}{\sum_{i=0}^{k}segmentDistance(ms_{i}),mss_{i}\in\ MaxSeg} \tag{1}\]  
where the segmentDistance(\(s\)) function calculates the length of a segment \(s\), i.e., the sum of the distances of the consecutive CPs of \(s\), see Equation (2). We calculate the distance between two consecutive CPs using the Euclidean distance formula.