php-ml/docs/machine-learning/metric/distance.md

18 lines
335 B
Markdown
Raw Normal View History

2016-04-08 22:36:48 +00:00
# Distance
Special class for calculation of different types of distance.
### Euclidean
![euclidean](https://upload.wikimedia.org/math/8/4/9/849f040fd10bb86f7c85eb0bbe3566a4.png "Euclidean Distance")
To calculate euclidean distance:
```
$a = [4, 6];
$b = [2, 5];
Distance::euclidean($a, $b);
// return 2.2360679774998
```