2D Translation Matrix Implementation
Matrix Algebra DS practice problem on Onlearn.
Difficulty: medium.
Topics: Understanding 2D Translation Matrix Implementation, 2D Translation Vector, Cartesian Point Representation, Element-wise Vector Addition, Homogeneous Coordinates (for translation), List Iteration/Mapping, Immutable Data Transformation, Linear Algebra, Computer Graphics, Computational Geometry, Numerical Methods, Applied Mathematics, Software Engineering, Geometric Transformations, Vector Arithmetic, Coordinate System Transformations, Algorithm Design Patterns, Data Structure Manipulation, Mathematical Modeling.
Task: Implement a 2D Translation Matrix Your task is to implement a function that applies a 2D translation matrix to a set of points. A translation matrix is used to move points in 2D space by a specified distance in the x and y directions. Write a function translate object(points, tx, ty) where points is a list of [x, y] coordinates and tx and ty are the translation distances in the x and y directions, respectively. The function should return a new list of points after applying the translation matrix.