Skip to content

Instantly share code, notes, and snippets.

@Dammmien
Created March 10, 2018 14:03
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 Dammmien/eacfe65111055fb173f3cac3a33768aa to your computer and use it in GitHub Desktop.
Save Dammmien/eacfe65111055fb173f3cac3a33768aa to your computer and use it in GitHub Desktop.
Get euclidean distance between two points A and B
const getDistance = (A, B) => Math.sqrt( Math.pow( B.x - A.x, 2 ) + Math.pow( B.y - A.y, 2 ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment