cosineDist {YAPSA} | R Documentation |
Compute the cosine distance of two vectors
cosineDist(a, b)
a, b |
Numerical vectors of same length |
The scalar product of the two input vectors divided by the product of the norms of the two input vectors
## 1. Orthogonal vectors: cosineDist(c(1,0),c(0,1)) ## 2. Non-orthogonal vectors: cosineDist(c(1,0),c(1,1)) ## Compare trigonometry: 1-cos(pi/4)