Given a set of cartesian coordinates representing an object's trajectory, this function returns approximated headings computed as the direction of vectors between successive points.
heading(x, y, geo = FALSE)
A vector of x (or longitude) coordinates corresponding to a single animal trajectory.
A vector of y (or latitude) coordinates corresponding to a single animal trajectory.
A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.
A vector of the same length as x and y corresponding to approximated headings along a [x, y] trajectory.