计算两点之间的距离
MxDraw网页开发|黄洪辉|2018-05-04 14:53
-
回答:
var point1 = mxOcx.GetPoint(false,0,0,"\n 点取第一点:"); if(point1 == null) { alert("用户取消"); return; } var point2 = mxOcx.GetPoint(true,point1.x,point1.y,"\n 点取第二点:"); if(point1 == null) { alert("用户取消"); return; } var dDis=Math.abs((point1.x - point2.x) * (point1.x - point2.x) + (point1.y - point2.y) * (point1.y - point2.y)); alert("两点距离:" + dDis.toString());