Graphical explanation for the equation used to calculate points of a vector in a base in $R^3$ I am currently taking a course in linear algebra and I am having difficulty understanding the point and visual/graphical derivation of the following in my course book:
If $B=(u_1,u_2,u_3)$ is an orthogonal base in the room ($R^3$) and $v$ is a vector in the room. Then it follows that
$$v=\begin{pmatrix}\frac{u_1\cdot v}{|u_1|^2} \end{pmatrix}u_1 + \begin{pmatrix}\frac{u_2\cdot v}{|u_2|^2} \end{pmatrix}u_2 +\begin{pmatrix}\frac{u_3\cdot v}{|u_3|^2} \end{pmatrix}u_3$$
The reason for this equation is given by the book as follows:
Because $B$ is a base, we get $v=a_1u_1+a_2+u_2+a_3u_3$ for adequate choices of real values for $a_1,a_2,a_3$. If we multiply this equation with $u_1$ we get $v\cdot u_1=a_1u_1\cdot u_1+a_2u_2\cdot u_1+a_3u_3\cdot u_1=a_1|u_1|^2$
I am having a difficult time understanding here when it is multiplication and when it is the dot product. Here it looks as if it is the dot product since everything except $a_1|u_1|^2$ cancels out (My guess is that $a_1\cdot a_x, x \in \mathbb{R}$ is orthogonal and therefor results in 0). However I have recently learned that "regular" algebraic simplification applies rarely in linear algebra. Is what is happening here the same as doing the dot product the following way: $u_1\cdot (v_1+v_2)=v_1\cdot u_1+v_2 \cdot u_1$?
Then the book simplifies the last equation to be $a_1=\frac{v\cdot u_1}{|u_1|^2}$. I follow that simplification and the fact that we do the same for $a_2$ and $a_3$ and put them back in our equation to get the first equation $v=...$.
The questions I am trying to get across and get answered is both the question in bold above and also the question I got confused with in the first place:
What does this equation actually mean? Graphically speaking.
What is the dot product of two vectors divided by the length of one of them squared times the first vector, besides mathematical nonsense? Obviously it is not nonsense and that is what I am trying to see.
 A: Let's try to unpack this problem step by step.
Since $B$ is a basis we can write any vector $v \in \mathbb{R}^3$ uniquely as $a_1u_1 + a_2u_2 + a_3u_3$ where $v = a_1, a_2, a_3 \in \mathbb{R}$. In that equation the multiplication is just scalar multiplication since $a_i$ is a scalar and $u_i$ is a vector. Next we can dot product $v$ with $u_1$, $v \cdot u_i$. And we can substitute in $v$ to get:
$$ v \cdot u_1 = (a_1u_1 + a_2u_2 + a_3u_3) \cdot u_1$$
and simplify using the linearity of the dot product to get:
$$ = (a_1 u_1) \cdot u_1 + (a_2u_2) \cdot u_1 + (a_3 u_3) \cdot u_1 $$
$$ = a_1(u_1 \cdot u_1) + a_2 (u_2 \cdot u_1) + a_3(u_3 \cdot u_1) $$
Since the basis is orthogonal we know that $u_2 \cdot u_1 = 0$ and $u_3 \cdot u_1 = 0$ (since the dot product of orthogonal vectors is $0$). This allows us to further simplify to:
$$ v \cdot u_1 = a_1|u_1|^2 $$
$$a_1=\frac{v\cdot u_1}{|u_1|^2}$$
We could have done the same for $u_2$ and $u_3$ so we have similar equations for $a_2$ and $a_3$.
Graphically what we've done is project $v$ onto each of the basis vectors. The term $\frac{v\cdot u_1}{|u_1|^2}u_1$ is the projection of $v$ onto $u_1$.
