average_bearing: Average of bearings

View source: R/average_bearing.R

average_bearingR Documentation

Average of bearings

Description

Average of bearings

Usage

average_bearing(theta1, theta2, average_of_opposite = NULL)

average_bearing_n(thetas)

Arguments

theta1, theta2

Bearings, expressed in degrees.

average_of_opposite

The average of opposing bearings (e.g. average of north and south) is not well-defined. If NULL, the result for opposing vectors is undefined; if "right", returns theta1 + 90; if "left" then theta2 + 90. Can also be a single numeric to provide a specific value when the vectors point in opposite directions.

thetas

A vector of bearings.

Value

For 'average_bearing', the bearing bisecting the two bearings.

For 'average_bearing_n', the average bearing of the bearing.

Examples

average_bearing(0, 90)
average_bearing(0, 270)
average_bearing(90, 180)

average_bearing(0, 180)
average_bearing(0, 180, average_of_opposite = 3)
average_bearing(0, 180, average_of_opposite = "left")

average_bearing_n(1:179)


hutils documentation built on April 13, 2022, 5:23 p.m.