translation function

List<num> translation(
  1. num tx,
  2. num ty
)

Creates a 2D translation matrix tx amount to translate in x ty amount to translate in y

Implementation

List<num> translation(num tx, num ty) {
  return [
    1, 0, 0,
    0, 1, 0,
    tx, ty, 1,
  ];
}