Skip to contents

This function returns the turning angles of a great circle track. This angle represents the relative angle between the consecutive segments.

Usage

# S4 method for class '.MoveTrackSingle'
turnAngleGc(x)

Arguments

x

a move, moveStack or moveBurst object, in long/lat projection

Details

On great circle tracks the bearing of arrival on a point is not the same as witch the previous point was left. This function returns the difference between these bearings between -180 and 180. The bearings are calculated using the functions bearing and finalBearing of the geosphere package.

Author

Bart Kranstauber & Anne Scharf

Value

Angles in degrees (between -180 and 180)

If a move or moveBurst object is provided, a numeric vector two elements shorter than the number of locations is obtained.
If a moveStack object is provided, a list with one element per individual containing a numeric vector two elements shorter than the number of locations is obtained.

See also

Examples

## turnAngleGc from a Move object 
data(leroy)
head(turnAngleGc(leroy))
#> [1]   55.96892 -130.93488 -159.69985   24.84488 -179.16947  108.65990
# to add this information to the move object, a "NA" has to be assigened
# to the first and last location.
leroy$turnAngleGc <- c(NA, turnAngleGc(leroy), NA)

## turnAngleGc from a MoveStack object
data(fishers)
str(turnAngleGc(fishers))
#> List of 2
#>  $ Leroy  : num [1:917] 56 -130.9 -159.7 24.8 -179.2 ...
#>  $ Ricky.T: num [1:998] -45.5 -88.4 -60.7 155.4 -108.9 ...
# to add this information to the moveStack object, a "NA" has to be assigened
# to the first and last location of each individual
fishers$turnAngleGc <-unlist(lapply(turnAngleGc(fishers), function(x) c(NA, x, NA)))