Skip to contents

Angles cannot be given exactly since vector angle relies on the vector length as well as acos. This function calculate the angle between two geometries. This is defined for surfaces, curves, and arrows. If a surface is supplied the angle will be calculated based on the surface normal and modified to match the original geometry.

Usage

approx_angle(x, y)

Arguments

x, y

Geometry vectors. Only surfaces, curves, and arrows are allowed

Value

A numeric vector given angular difference in radians

See also

Examples

# Angle between two lines
approx_angle(line(3, 7, -1), line(-5, 4, 2))
#> [1] 1.300947

# Angle between vector and plane
approx_angle(plane(-4, 1, 19, -4), vec(5, -7, 2))
#> [1] 1.506691