Skip to contents

Calculate circular difference.

Usage

getCircDiff(x, y, period = 1, towardZero = TRUE)

Arguments

x

Numeric vector or matrix.

y

Numeric vector or matrix.

period

Period of the periodic variable.

towardZero

If TRUE, returned values will be between -period / 2 and period / 2. If FALSE, returned values will be between 0 and period.

Value

Vector or matrix corresponding to x - y.