Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active August 20, 2023 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/ee56984fadcd35eb91b7e2617eec875a to your computer and use it in GitHub Desktop.
Save mcsee/ee56984fadcd35eb91b7e2617eec875a to your computer and use it in GitHub Desktop.
<?
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