All mock tests are FREE till 31 December — register to save your progress

What is the transformation matrix that transforms the square with vertices (1, 1), (−1, 1), (−1, −1), (1, −1) into the parallelogram with corresponding vertices (2, 1), (0, 1), (−2, −1), (0, −1)?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. M = [1 1 0; 0 1 0; 0 0 1]

Explanation

Each point maps (x, y) → (x + y, y): (1,1) → (2,1), (−1,1) → (0,1), (−1,−1) → (−2,−1), (1,−1) → (0,−1). That is the x-shear matrix with 1 in the top-middle entry.

More Programming Languages and Computer Graphics questions