Skip to contents

Given a set of locations defining a trajectory, this function approximates their instantaneous angular accelerations computed as the difference between successive angular speeds.

Usage

ang_acc(x, y, t, geo = FALSE)

angAcc(x, y, t, geo = FALSE)

Arguments

x

A vector of x (or longitude) coordinates corresponding to a single trajectory.

y

A vector of y (or latitude) coordinates corresponding to a single trajectory.

t

A vector of timestamps corresponding to a single trajectory.

geo

A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.

Value

A vector of the same length as x, y and t corresponding to the approximated instantaneous angular accelerations along the trajectory.

See also

Author

Simon Garnier, garnier@njit.edu

Examples

x <- rnorm(25)
y <- rnorm(25, sd = 3)
t <- as.POSIXct(1:25, origin = Sys.time())
ang_acc(x, y, t)
#>  [1]         NA         NA         NA  0.2169078  2.8697799  3.1217569
#>  [7] -4.6224214  3.7562801  0.8987185 -3.8196663  3.5847730 -0.1338105
#> [13] -5.9022073  0.5365483  0.2641515  4.6737528 -4.5185011  0.7501994
#> [19] -1.4159224  5.6264281 -5.4121270  5.6771272 -6.0477115  0.1696109
#> [25]  5.6630741