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

Function addVector

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

Source from the content-addressed store, hash-verified

4export const scaleVector = ([x, y], n) => [x * n, y * n];
5
6export const addVector = (a, b) => {
7 const [ax, ay] = a;
8 const [bx, by] = b;
9 const x = ax + bx;
10 const y = ay + by;
11 return [x, y];
12};
13
14export const subtractVector = (a, b) => {
15 const [ax, ay] = a;

Callers 5

getCornersCenterFunction · 0.90
getMovedCornersFunction · 0.90
getAddedCornersFunction · 0.90
ibilerpFunction · 0.90
hand.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected