```python
%pylab inline
```

    Populating the interactive namespace from numpy and matplotlib



```python
from sympy.parsing.sympy_parser import parse_expr
from sympy import Matrix, symbols, expand
```


```python
xs = np.linspace(-1,1,32)
ys = np.linspace(-1,1,32)
X, Y = np.meshgrid(xs, ys)
fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111)
ax.set_aspect(1)
mat = np.array([[.87,-.2],[.20,2]])
X, Y = zip(*[np.matmul(mat, np.array([x, y])) for x, y in zip(X.ravel(), Y.ravel())])
plot(X,Y,'o',c='purple',markersize=4);
axhline(0, lw=1, c='black')
axvline(0, lw=1, c='black')
xlim(-2,2)
ylim(-2,2)
plt.axis("on")
#xlim(-2,2)
#ylim(-2,2)
```


```python
mat = np.array([[.5,0],[0,2]])
```


```python
xs, ys = zip(*[np.matmul(mat, np.array([x, y])) for x, y in zip(X.ravel(), Y.ravel())])
plot(xs,ys,'o',c='purple',markersize=4);
```


```python
np.matmul(mat, np.array([1,0]))
```




    array([2, 2])




```python
np.dot(mat, np.array([1,1]))
```




    array([4, 4])




```python
def interpolate(M,N,alpha): return (1-alpha) * M + alpha * N
```


```python
interpolate(mat, np.eye(2), 0.5)
```




    array([[0.75, 0.  ],
           [0.  , 1.5 ]])




```python
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(16,10))

angle = 1/2*np.pi
mat = np.array([[np.cos(angle), np.sin(angle)],[ -np.sin(angle), np.cos(angle)]])
xs = np.linspace(-1,1,32) #np.array([1,-1])
ys = np.linspace(-1,1,32) #np.array([1,-1])
X, Y = np.meshgrid(xs, ys)
N = 6
for n in range(0, N+1):
    ax = fig.add_subplot(N+1, 1, n+1)
    ax.set_aspect(1)
    #plt.axis([0, 4, 0, 4])
    
    xs, ys = zip(*[np.matmul( interpolate(np.eye(2), mat, n/N), np.array([x, y])) for x, y in zip(X.ravel(), Y.ravel())])
    
    plot(xs,ys,'o',c='purple',markersize=4);
    axhline(0, lw=1, c='black')
    axvline(0, lw=1, c='black')
    plt.axis("off")

plt.tight_layout(pad=0)

plt.show()
```


```python

```

e398c73f9d40a08ad489f7743927dd4a5216fe91
ipynb
Jupyter Notebook
Calcupy/transformation plot 2d.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
2018-08-28T12:16:12.000Z
2018-08-28T12:16:12.000Z
Calcupy/transformation plot 2d.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
Calcupy/transformation plot 2d.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
Qwen/Qwen-72B
1. YES
2. YES