Skip to content

Instantly share code, notes, and snippets.

@jremmen
Created July 14, 2013 01:32
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 jremmen/5992854 to your computer and use it in GitHub Desktop.
Save jremmen/5992854 to your computer and use it in GitHub Desktop.
calculate distance between two points
var Point = function(x, y) {
this.x = x;
this.y = y;
};
function getDistance(a, b) {
return Math.sqrt(Math.pow((a.x - b.x), 2) + Math.pow((a.y - b.y), 2));
};
@yckart
Copy link

yckart commented May 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment