Skip to contents

Calculate angle between three consecutive points

Usage

three_point_angle(x)

Arguments

x

matrix with first two columns assumed to contain x, y coordinates.

Value

numeric angle defined by the three points, where the second point is considered the vertex.

Examples

x <- cbind(x=c(1, 1, 3), y=c(2, 1, 1))
three_point_angle(x)
#>  y 
#> 90