View source: R/euclidean_distance.R
euclidean_distance | R Documentation |
This function calculates the euclidean distance between 2 points. They must have the same number of dimensions
euclidean_distance(p1, p2)
p1 |
One of the points that will be used by the algorithm with N dimensions |
p2 |
The other point that will be used by the algorithm with N dimensions |
Euclidean Distance calculated between the two N-dimensional points
Andres Missiego Manjon
inputData = t(matrix(c(3,2,3.5,12,4.7,4.1,5.2,
4.9,7.1,6.1,6.2,5.2,14,5.3),2,7,dimnames=list(c("r","d"))));
inputData = data.frame(inputData);
point1 = inputData[1,];
point2 = inputData[4,];
distance = euclidean_distance(point1, point2);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.