php-ml/docs/machine-learning/metric/distance/euclidean.md
2016-04-13 21:20:55 +02:00

19 lines
332 B
Markdown

# Euclidean
Class for calculation Euclidean distance.
### Euclidean
![euclidean](https://upload.wikimedia.org/math/8/4/9/849f040fd10bb86f7c85eb0bbe3566a4.png "Euclidean Distance")
To calculate distance:
```
$a = [4, 6];
$b = [2, 5];
$euclidean = new Euclidean();
$euclidean->distance($a, $b);
// return 2.2360679774998
```