Description Usage Arguments Value Examples
View source: R/basic_functions.R
Compute the cosine distance of two vectors
1 | 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 2 3 4 5 6 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.