MCPcopy Create free account
hub / github.com/algorithm-visualizer/algorithm-visualizer / distance

Function distance

src/common/util.js:3–7  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

1const classes = (...arr) => arr.filter(v => v).join(' ');
2
3const distance = (a, b) => {
4 const dx = a.x - b.x;
5 const dy = a.y - b.y;
6 return Math.sqrt(dx * dx + dy * dy);
7};
8
9const extension = fileName => /(?:\.([^.]+))?$/.exec(fileName)[1];
10

Callers 2

layoutRandomMethod · 0.90
handleMouseDownFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected