mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-12-11 13:22:19 +00:00
19 lines
332 B
Markdown
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
|
|
```
|