Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function getDistanceBetween(PointInterface $pointA, PointInterface $pointB): float |
||
13 | { |
||
14 | if (! $pointA instanceof Point || ! $pointB instanceof Point) { |
||
15 | throw new \InvalidArgumentException( |
||
16 | "Euclidean Algorithm can only calculate distance between euclidean points" |
||
17 | ); |
||
18 | } |
||
19 | |||
20 | return Math::euclideanDist($pointA->getCoordinates(), $pointB->getCoordinates()); |
||
21 | } |
||
36 |