js求平面两点之间的距离,前端js小知识
let a = {x:'6', y:10}, b = {x: 8, y: 20}; function distant(a,b){ let dx = Number(a.x) - Number(b.x) let dy = Number(a.y) - Number(b.y) return Math.pow(dx*dx + dy*dy, .5) }
13437224711 / 15818089910
扫描二维码与销售顾问咨询