Learn R Programming

tectonicr (version 0.4.6)

angle_vectors: Angle Between Two Vectors

Description

Calculates the angle between two vectors

Usage

angle_vectors(x, y)

Value

numeric. angle in degrees

Arguments

x, y

Vectors in Cartesian coordinates. Can be vectors of three numbers or a matrix of 3 columns (x, y, z)

Examples

Run this code
u <- c(1, -2, 3)
v <- c(-2, 1, 1)
angle_vectors(u, v)

Run the code above in your browser using DataLab