Last active
August 20, 2023 20:28
-
-
Save mcsee/ee56984fadcd35eb91b7e2617eec875a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
final class Point { | |
public $x; | |
public $y; | |
} | |
final class DistanceCalculator { | |
function distanceBetween(Point $origin, Point $destination) { | |
return sqrt((($destination->x - $origin->x) ^ 2) + | |
(($destination->y - $origin->y) ^ 2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment