Skip to main content
. 2023 Apr 20;23(8):4130. doi: 10.3390/s23084130
Algorithm 3 Computation of wandering style
Data: User’s trajectory data (pos = (x, y), array)
Results: Wandering style (ws) feature
1 cells ← unique((round (pos(x)), round(pos(y))))
2 i = 1, trajectory_length = 0
3 while i < length(pos) do
4  distance ← √(posi x) − posi−1(x))2 + (posi(y) − posi−1(y))2
5  trajectory_length ← trajectory_length + distance
6 end
7 if trajectory_length > 0 then
8  ws ← length (cells)/trajectory_length
9 else
10  ws ← 0
11 end
12 end