The Duck

Consider the matrix \(\texttt{duck}= \begin{bmatrix} 0& 1 & 1 & 1.5 \quad 2.5 \quad 3 & 3 \quad 4 \quad 2 &\;\;\;\; 2 \;\;\;\quad 1 \;\;& -3.7 & -5 \quad -4 \quad -3 & 0\\ 1 & 0& 3.5 &\;\; 4 \quad\; 4 \quad\;\; 3.5 & 3\quad 3 \quad 2 & -1 \quad -2 & -2 &\; 1 \;\;\;\quad 0\;\; \quad \;\;1\; & 1 \end{bmatrix}. \)

The columns of this matrix are the points of a piecewise linear polygon that looks like a duck. The Python comands to plot the duck are

import numpy as np 
import pylab as plt

duck = np.array([ "the matrix goes here in correct numpy array format..."  ])

plt.plot(duck[0,:],duck[1,:])
plt.show()

Let \(\tt A\) be a \(2 \times 2\) matrix. Multiplying the duck from the left with a matrix \({\tt A*duck}\) gives a new matrix, whose columns are the points of a transformed duck. Write a program that generates a figure with four pictures: 1.) the original duck, 2.) the duck rotated by 90 degree, 3.) the duck stretched by a factor 2, 4.) the duck sheared horizontally by a factor 2.

Your figure should look like this.