Get directedness
get_directedness.Rd
Gets the directedness of a trajectory over a given time window, as a function of time.
Arguments
- x_i
vector of x positions for an individual (or the group centroid) of length
n_times
- y_i
vector of y positions for an individual (or the group centroid) of length
n_times
- t_window
window of time to use for computing directedness (must be an even number) - the directedness for time t will be computed using position data from
t - t_window / 2
tot + t_window / 2
Details
The directedness a number which ranges from 0 to 1 where 1 is a straight path and 0 is a highly tortuous path. It is defined as the net displacement (distance along a straight-line path from point A to point B) divided by the path length (total distance traveled along the actual path from point A to point B).
NOTE: Keep in mind that the time window t_window
should be given as the number of time points of data to use when computing directedness, so the unit is number of timesteps, not seconds.