manyspikes

Build your own transformations

Initialising environment...

In this exercise, you are going to build matrices that perform the following transformations in 2-D space:

  1. Flip a vector vertically: if it points up, its transform should point down (and vice-versa)
  2. Flip a vector horizontally: if it points left, its transform should point right (and vice-versa)
  3. Rotate by 90 degrees clockwise
  4. Rotate by 90 degrees counterclockwise
  5. Stretch a vector by a factor of 2 horizontally and flip it vertically

While building the transformation matrices, It's helpful to think about where the basis vectors should land under that transformation.

Instructions

You must define four variables called A, B, C, D and E. A transformation matrix must be assigned to each of the variables, so that:

  1. The matrix A must flip a vector vertically
  2. The matrix B must flip a vector horizontally
  3. The matrix C must rotate a vector 90 degrees clockwise
  4. The matrix D must rotate a vector 90 degrees counterclockwise
  5. The matrix E must stretch a vector by a factor of 2 horizontally and flip it vertically

As an example, here is a matrix F which flips both a vector both horizontally and vertically.

F = [[-1,0], [0, -1]]