angleCells: Angle between Two Tracks

angleCellsR Documentation

Angle between Two Tracks

Description

Compute the angle between the displacement vectors of two tracks in the dataset, or of several such pairs at once. Note that in contrast to distanceCells, this angle is computed even when the two tracks do not share any time points.

Usage

angleCells(X, cellids, degrees = TRUE)

Arguments

X

a tracks object

cellids

a vector of two indices specifying the tracks to get steps from, or a dataframe/matrix of two columns (where every row contains a pair of cellids to compute an angle for)

degrees

logical; should angle be returned in degrees instead of radians? (defaults to TRUE)

Value

A single angle (if two cellids given), or a vector of angles (if multiple pairs of cellids are supplied).

See Also

distanceCells to compute the minimum distance between the tracks, and AngleAnalysis for other methods to compute angles and distances.

Examples

## Find the angle between the tracks with ids 1 and 3
angleCells( TCells, c("1","3") )

## Find the angles of several cell pairs at once
pairs <- data.frame( cell1 = c("1","1"), cell2 = c( "3","4" ) )
angleCells( TCells, pairs )

celltrackR documentation built on March 21, 2022, 5:06 p.m.