flyangle: Track angle calculator

Description Usage Arguments Details Value

Description

Calculates the angle of the velocity vector in rad by comparing centroid location across framelag.

Usage

1
flyangle(trx, framelag = 6)

Arguments

trx

a track data frame (only requires CTrax output variables)

framelag

the number of frames to derive velocity across; defaults to 6

Details

For each timepoint t the velocity vector is calculated between t-framelag/2 and t+framelag+2. Currently this leaves framelag/2 NAs at the beginning and end of each track. This causes all sorts of problems and may be best addressed somehow in the future.

The angle is expressed in reference to the (arbitrary) coordinate system of the video and therefore this value is not overly useful.

Value

A numeric vector matching the structure of trx containing the angle value for each object and timepoint, or NAs when it can't be calculated.


PaolaCognigni/CTraxHelper documentation built on May 7, 2019, 11:57 p.m.