javascript 获取两点的像素距离

1 getPosLen(sdot, edot){//获取2点距离
2         /* 
3         56 40 56
4         40 00 40
5         56 40 56
6         */
7         return parseInt(Math.sqrt(Math.pow(Math.abs(sdot.x - edot.x), 2) + Math.pow(Math.abs(sdot.y - edot.y), 2)));
8 }
原文地址:https://www.cnblogs.com/weihexinCode/p/12317523.html