Skip to contents

Computes the non-negative angular distance between x and y. With the default period, values are returned in [0, pi].

Usage

angular_distance(x, y, period = 2 * pi)

Arguments

x, y

Numeric vectors of angles.

period

Positive numeric period.

Value

A non-negative numeric vector.

Examples

angular_distance(0, 3 * pi / 2)
#> [1] 1.570796