angular_similarity: Angular similarity

Description Usage Arguments Value Examples

Description

The normalised angle between two vectors, bounded between 0 and 1. A value of 1 indicates the two vectors have a similarity of 0 degrees. While two vectors diametrically opposed have a value of 0.

Usage

1

Arguments

a

Vector

b

Vector

Value

out Angle similarity, between 0 and 1

Examples

1
2
3
4
5
6
7
8
a <- c(-1, 0)
b <- c(-1, -1)
angular_similarity(a, b)

# Vectors of length > 2
x <- c(1, 4, 2, 2.5)
y <- c(5, 200, 4, -1)
angular_similarity(x, y)

Swarchal/TCCS documentation built on May 9, 2019, 3:24 p.m.