MCPcopy Create free account
hub / github.com/TodePond/ScreenPond / distanceBetweenVectors

Function distanceBetweenVectors

source/vector.js:28–33  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

26};
27
28export const distanceBetweenVectors = (a, b) => {
29 const displacement = subtractVector(a, b);
30 const [dx, dy] = displacement;
31 const distance = Math.hypot(dx, dy);
32 return distance;
33};
34
35export const angleBetweenVectors = (a, b) => {
36 const displacement = subtractVector(a, b);

Callers 2

getCornersPerimeterFunction · 0.90

Calls 1

subtractVectorFunction · 0.85

Tested by

no test coverage detected