Skip to content

Instantly share code, notes, and snippets.

@luckyshot
Created September 9, 2020 09:56
Show Gist options
  • Select an option

  • Save luckyshot/9fe1be5a5332f8fa02abdaf8eda65bd8 to your computer and use it in GitHub Desktop.

Select an option

Save luckyshot/9fe1be5a5332f8fa02abdaf8eda65bd8 to your computer and use it in GitHub Desktop.

Revisions

  1. luckyshot created this gist Sep 9, 2020.
    10 changes: 10 additions & 0 deletions distance.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?php

    function distance($x1, $y1, $x2, $y2){
    return sqrt(
    pow(abs($x1 - $x2), 2)
    +
    pow(abs($y1 - $y2), 2)
    );
    }