# Vector

## Create a 3D Cartesian coordinate system


```python
# Create a 3D Cartesian coordinate
from sympy.vector import CoordSys3D

N = CoordSys3D('')
```

## Add unit vector along the x axis $$N\vec{i}$$


```python
# Add unit vector along the axes
N.i
```




$\displaystyle \mathbf{\hat{i}_{}}$




```python
type(N.i)
```




    sympy.vector.vector.BaseVector



## Create a vector A $$\vec{A} = N\vec{i} + N\vec{j} + N\vec{k}$$


```python
# Create a vector A
vect_A = N.i + N.j + N.k
vect_A
```




$\displaystyle \mathbf{\hat{i}_{}} + \mathbf{\hat{j}_{}} + \mathbf{\hat{k}_{}}$



## Add an operation to the vector $$3\times N\vec{j}$$


```python
# Add an operation to the vector
vect_A = N.i + 3*N.j + N.k
vect_A
```




$\displaystyle \mathbf{\hat{i}_{}} + (3)\mathbf{\hat{j}_{}} + \mathbf{\hat{k}_{}}$



## Create a vector B $$\vec{B} = 2\times N\vec{i} + N\vec{j} + N\vec{k}$$


```python
# Create a vector B
vect_B = 2*N.i + N.j + N.k
vect_B
```




$\displaystyle (2)\mathbf{\hat{i}_{}} + \mathbf{\hat{j}_{}} + \mathbf{\hat{k}_{}}$



## Vector Dot Product $$\vec{A}\cdot\vec{B}$$


```python
# vector A . vector B
vect_A & vect_B
```




$\displaystyle 6$



## Vector Cross Product $$\vec{A}\times\vec{B}$$


```python
# vector A x vector B
vect_A ^ vect_B
```




$\displaystyle (2)\mathbf{\hat{i}_{}} + \mathbf{\hat{j}_{}} + (-5)\mathbf{\hat{k}_{}}$



c57ea4c56e9da7c419389144a78ce96dd2eee178
ipynb
Jupyter Notebook
vector.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
2021-11-30T10:05:29.000Z
2021-12-30T13:39:08.000Z
vector.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
vector.ipynb
ricoen/learn-math
fc84bc4d0dc353f8ccb3c52e36155069e9ca5af4
MIT
Qwen/Qwen-72B
1. YES
2. YES