mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-12-04 10:58:23 +00:00
18 lines
335 B
Markdown
18 lines
335 B
Markdown
|
# 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
|
||
|
```
|