EuclideanDistance Method (Double, Double) |
Namespace: Accord.Math.Distances
// Let's say the coordinates of the first 2D vector are double x1 = 1.5; double y1 = -2.1; // And then the coordinates of the second 2D vector are: double x2 = 4; double y2 = 1; // The euclidean distance between (x1, y1) and (x2, y2) are: double a = Distance.Euclidean(x1, y1, x2, y2); // should be ~3.9824615503479754 // This is equivalent to double b = Distance.Euclidean(new[] { x1, y1 }, new[] { x2, y2 });