UNPKG

simple-utils-js

Version:

前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown

9 lines (7 loc) 212 B
/** * @description: 计算两点之间的距离 * @param {*} `x1 y1 x2 y2`坐标点 * @return {*} number */ const getLineSize = (x1, y1, x2, y2) => Math.hypot(x2 - x1, y2 - y1) module.exports = getLineSize