Subtract one vector from another.
The target vector.
The vector to subtract.
Error - When a computed component is NaN or non-finite.
subtract({ x: 1, y: 1 }, { x: 1, y: 1 }); // -> { x: 0, y: 0 } Copy
subtract({ x: 1, y: 1 }, { x: 1, y: 1 }); // -> { x: 0, y: 0 }
Optional
Destination object to store the result.
let result = { x: 0, y: 0 };subtract({ x: 1, y: 1 }, { x: 1, y: 1 }, result); // -> { x: 0, y: 0 } Copy
let result = { x: 0, y: 0 };subtract({ x: 1, y: 1 }, { x: 1, y: 1 }, result); // -> { x: 0, y: 0 }
Subtract one vector from another.