```python
%pylab inline
```

    Populating the interactive namespace from numpy and matplotlib



```python
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from numpy import *
from matplotlib.patches import FancyArrowPatch
from mpl_toolkits.mplot3d import proj3d
font = {'size': 14}
matplotlib.rc('font', **font)
```


```python
class Arrow3D(FancyArrowPatch):
    def __init__(self, xs, ys, zs, *args, **kwargs):
        FancyArrowPatch.__init__(self, (0,0), (0,0), *args, **kwargs)
        self._verts3d = xs, ys, zs
    def draw(self, renderer):
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0],ys[0]),(xs[1],ys[1]))
        FancyArrowPatch.draw(self, renderer)
```


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


```python
vec2 = parse_expr('Matrix([1, 1])')
vec3 = parse_expr('Matrix([1, 1, 1])')
vec2, vec3
```




    (Matrix([
     [1],
     [1]]), Matrix([
     [1],
     [1],
     [1]]))




```python
V = np.array([vec2[0].evalf(), vec2[1].evalf()]).astype('float')
V
```




    array([1., 1.])




```python
U = np.array([vec3[0].evalf(), vec3[1].evalf(), vec3[2].evalf()]).astype('float')
U
```




    array([1., 1., 1.])




```python
plt.figure(figsize=(6,5))

magn = np.sqrt(V[0]**2 + V[1]**2)

plt.xlim([-2,2])
plt.ylim([-2,2])

plt.axis('equal')
X = [np.cos(x) for x in np.linspace(0, 2*np.pi, 64)]
Y = [np.sin(y) for y in np.linspace(0, 2*np.pi, 64)]

plot(X,Y, c='darkgray', lw=3)

annotate("", xy=(V[0]/magn, V[1]/magn), xytext=(0, 0),arrowprops=dict(arrowstyle="->", color="purple", lw=3))
axhline(0, ls='dashed', alpha=0.33, c='gray', lw=3)
axvline(0, ls='dashed', alpha=0.33, c='gray', lw=3)
```


```python

```

7196861204b95c1ce01cc00b7a35d08c3b1218ae
ipynb
Jupyter Notebook
Applied Math/Y2S2/.ipynb_checkpoints/vector plot 2d and 3d-checkpoint.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
2018-08-28T12:16:12.000Z
2018-08-28T12:16:12.000Z
Applied Math/Y2S2/.ipynb_checkpoints/vector plot 2d and 3d-checkpoint.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
Applied Math/Y2S2/.ipynb_checkpoints/vector plot 2d and 3d-checkpoint.ipynb
darkeclipz/jupyter-notebooks
5de784244ad9db12cfacbbec3053b11f10456d7e
Unlicense
Qwen/Qwen-72B
1. YES
2. YES