Subtracts two vectors.

Type signature

([x1, y1]: [number, number], [x2, y2]: [number, number]) => [number, number]

Examples

sub([3, 5], [-1, 8]);
// ⇒ [4, -3]
Try in REPL

Questions

  • How to subtract two vectors?

TypeScript sourceJavaScript source