Creates a translation matrix.

Type signature

(
  tx?: number,
  ty?: number
) => {
  a: number;
  c: number;
  e: number;
  b: number;
  d: number;
  f: number;
}

Examples

translate(2, 3);
// ⇒ { a: 1, b: 0, c: 0, d: 1, e: 2, f: 3 }
Try in REPL

Questions

  • How to create a translation matrix?

TypeScript sourceJavaScript source