line-length.js 318 B

12345678910
  1. import { __read } from "tslib";
  2. /**
  3. * 计算线段长度
  4. */
  5. export function lineLen(_a, _b) {
  6. var _c = __read(_a, 2), x1 = _c[0], y1 = _c[1];
  7. var _d = __read(_b, 2), x2 = _d[0], y2 = _d[1];
  8. return Math.pow((Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2)), 0.5);
  9. }
  10. //# sourceMappingURL=line-length.js.map