#math/calculus #math/linear-algebra
A vector is defined to have a magnitude and direction. The start of the vector is called the `tail` and the end as the `tip` or `head`. The start and end points are known as `initial point` and `terminal point`, respectively.
```tikz
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round, scale=0.9]
% the vector from P (tail) to Q (tip)
\draw[->, very thick, blue] (0.5,0.5) -- (4,2.6);
% endpoints
\fill (0.5,0.5) circle (1.8pt) node[below left]{$P$ \small(tail)};
\fill (4,2.6) circle (1.8pt) node[above right]{$Q$ \small(head)};
% label
\node[blue] at (2,2){$\overrightarrow{\mathbf{PQ}}$};
\end{tikzpicture}
\end{document}
```
When we are adding vectors together, it's good to observe them as `displacements`.
```tikz
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round, scale=0.9]
% faint axes through the origin
\draw[->, black!20] (-0.6,0) -- (5,0);
\draw[->, black!20] (0,-1.9) -- (0,3.6);
% B redrawn from the tip of A (tip-to-tail) -> reaches A+B
\draw[->, dashed, teal!70!black] (3,1) -- (4,3);
% other side of the parallelogram
\draw[dashed, black!35] (1,2) -- (4,3);
% A - B as the displacement from tip of B to tip of A (same as origin vector below)
\draw[->, dashed, orange!85!black] (1,2) -- (3,1);
% vectors from the origin
\draw[->, ultra thick, red!80!black] (0,0) -- (4,3) node[above right]{$\mathbf{A+B}$};
\draw[->, very thick, blue] (0,0) -- (3,1) node[below right]{$\mathbf{A}$};
\draw[->, very thick, teal] (0,0) -- (1,2) node[above left]{$\mathbf{B}$};
\draw[->, very thick, orange!85!black] (0,0) -- (2,-1) node[below right]{$\mathbf{A-B}$};
% origin
\fill (0,0) circle (1.6pt);
\end{tikzpicture}
\end{document}
```
Introducing points, we label the `origin` i.e. $(0,0) \text{ in }\mathbb{R}^{2}$ and $(0,0,0) \text{ in }\mathbb{R}^{3}$ as $O$. When a vector is drawn with its tail on the origin, its referred to as an `origin vector`. Thus with an origin vector, the coordinates of the head determine the vector. For example, using coordinates, we can write an origin vector $\mathbf{A}$ as
$
\mathbf{A}=\left\langle{} a_{1},a_{2} \right\rangle = a_{1}\mathbf{i} +a_{2}\mathbf{j}
$
The vectors $\mathbf{i}= \left\langle{} 1,0 \right\rangle$ and $\mathbf{j} =\left\langle{} 0,1 \right\rangle$ which represent represent the [[2B1 - Bases|standard basis]]. Addition and subtraction of vectors is as you'd intuit. The `magnitude` of a vector $\mathbf{A}$ is denoted as $|\mathbf{A}|$. If $\mathbf{A}=a_{1}\mathbf{i}+a_{2}\mathbf{j}$, then $|\mathbf{A}|=\sqrt{a_{1}^{2}+a_{2}^{2}}$ .
```tikz
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round, scale=1.0]
% faint axes
\draw[->, black!20] (-0.5,0) -- (5.2,0);
\draw[->, black!20] (0,-0.6) -- (0,3.7);
% A's legs: a1 (horizontal) then a2 (vertical)
\draw[very thick, blue] (0,0) -- (3,0) node[midway, below]{$a_1$};
\draw[very thick, blue] (3,0) -- (3,1) node[midway, right]{$a_2$};
% B's legs, starting from the tip of A: b1 then b2
\draw[very thick, teal] (3,1) -- (4,1) node[midway, below]{$b_1$};
\draw[very thick, teal] (4,1) -- (4,3) node[midway, right]{$b_2$};
% the three vectors drawn as the hypotenuses
\draw[->, semithick, blue!55!black, dashed] (0,0) -- (3,1) node[pos=0.55, above left]{$\mathbf{A}$};
\draw[->, semithick, teal!55!black, dashed] (3,1) -- (4,3) node[pos=0.5, above left]{$\mathbf{B}$};
\draw[->, ultra thick, red!80!black] (0,0) -- (4,3) node[above]{$\mathbf{A+B}$};
% guides to read the resultant's coordinates (kept off the staircase)
\draw[dashed, black!30] (4,1) -- (4,0);
\draw[dashed, black!30] (4,3) -- (0,3);
\node[red!70!black] at (2,-0.5){$a_1+b_1$};
\node[red!70!black, rotate=90] at (-0.4,1.5){$a_2+b_2$};
\fill (0,0) circle (1.6pt);
\end{tikzpicture}
\end{document}
```
Note in $\mathbb{R}^{3}$ the magnitude of a vector, $\mathbf{A}$ naturally becomes $|\mathbf{A}|=\sqrt{a_{1}^{2}+a_{2}^{2}+a_{3}^{2}}$. As a visual, consider $r=\sqrt{a_{1}^{2}+a_{2}^{2}}$ and then $|\mathbf{A}|=\sqrt{r^{2}+a_{3}^{2}}=\sqrt{a_{1}^{2}+a_{2}^{2}+a_{3}^{2}}$.
```tikz
\begin{document}
\begin{tikzpicture}[line cap=round, line join=round, scale=1.0]
% pseudo-3D axes
\draw[->, black!25] (0,0) -- (-1.9,-1.19) node[below left]{$x$};
\draw[->, black!25] (0,0) -- (3.6,0) node[right]{$y$};
\draw[->, black!25] (0,0) -- (0,3.3) node[above]{$z$};
% components a1 (along x) and a2 (along y) forming r in the xy-plane
\draw[dashed, black!45] (0,0) -- (-0.88,-0.55) node[midway, above left]{$a_1$};
\draw[dashed, black!45] (-0.88,-0.55) -- (1.5,-0.55) node[midway, below]{$a_2$};
% r : projection of A onto the xy-plane
\draw[->, very thick, blue] (0,0) -- (1.5,-0.55) node[below right]{$r$};
% a3 : rise along z
\draw[->, very thick, teal] (1.5,-0.55) -- (1.5,1.65) node[midway, right]{$a_3$};
% the vector A and its magnitude
\draw[->, ultra thick, red!80!black] (0,0) -- (1.5,1.65) node[above right]{$\mathbf{A},\ |\mathbf{A}|$};
% dashed guide closing the vertical triangle
\draw[dashed, black!30] (0,0) -- (1.5,-0.55);
\fill (0,0) circle (1.6pt);
\end{tikzpicture}
\end{document}
```
**Notation**
$
\begin{align}
(a_{1},a_{2}) & \quad \ldots \quad \text{is a point in the plane} \\
\left\langle{} a_{1},a_{2} \right\rangle = a_{1}\mathbf{i}+a_{2}\mathbf{j} & \quad \ldots \quad \text{is the vector drawn from origin to point } (a_{1},a_{2}) \\
a_{1} \text{ and }a_{2} \text{ in }\mathbf{A}=a_{1}\mathbf{i}+a_{2}\mathbf{j} & \quad \ldots \quad \text{are called the } \mathbf{i } \text{ and }\mathbf{j} \text{ components of }\mathbf{A}\\
\overrightarrow{\mathbf{P}} \text{ and }\overrightarrow{\mathbf{OP}} & \quad \ldots\quad \text{is the origin vector from origin to }\mathbf{P} \\
\overrightarrow{\mathbf{PQ}} & \quad \ldots\quad \text{is the displacement from }\mathbf{P} \text{ to }\mathbf{Q}
\end{align}
$