# Linear Algebra - Vector ## Vector :::info Some key points you should know in highschool. ::: 1. How to calculate the length of a given vector? 1. How to calculate the distance between two points?(Basically same as previous one) 1. How to calculate the angle between two vectors using the **law of cosine**? * law of cosine : $cos(C)=\cfrac{a^2+b^2-c^2}{2ab}$ 1. How to calculate the angle between two vectors using the **inner product**? * given two vectors : $\vec{X}$=$(x_1,...,x_n)$ and $\vec{Y}$=$(y_1,...,y_n)$ * inner product : $\sum_{i=1}^{n}x_iy_i$ =$|\vec{X}||\vec{Y}|cos(\theta)$ ANS: :::spoiler 1. set vector $\vec{A}$ = $(a_1,a_2,...a_n)$, the length of $\vec{A}$ is $\vec{A}=\sqrt{a_{1}^2+a_{2}^2+...+a_{n}^2}$ 2. set two point x = $(x_1,x_2,...x_n)$ and y = $(y_1,y_2,...y_n)$, the distance between x and y is $|x-y|=\sqrt{(x_{1}-y_{1})^2+(x_{2}-y_{2})^2+...+(x_{n}-y_{n})^2}$ 3. angle between two vectors is $\theta=cos^{-1}(\cfrac{|\vec{A}|^2+|\vec{B}|^2-|\vec{A}-\vec{B}|^2}{2|\vec{A}||\vec{B}|})$ 4. angle between two vectors is $\theta=cos^{-1}(\cfrac{\sum_{i=1}^{n}a_ib_i}{|\vec{A}||\vec{B}|})$ :::