Math.hypot(x2-x1, y2-y1)
function distance(x1, y1, x2, y2) { return Math.hypot(x2-x1, y2-y1) }
var a = x1 - x2; var b = y1 - y2; var c = Math.sqrt( a*a + b*b ); // c is the distance