Why is it that the dot product of two vectors $u_1=(a, b, c)$ and $u_2=(x, y, z)$ plays out like this: $u_1 \cdot u_2 = ax+by+cz$. I have seen and understand why this is the case for 2D but why is it the case for 3D? I though the dot product is $|u||v|\cos \theta$? This would result in $\sqrt{a^2+b^2+c^2} \sqrt{x^2+y^2+z^2} \cos \theta$. Are they the same?
Edit: Again, I have seen the proof for the second dimension but I have not seen any proof for the equation $u_1 \cdot u_2 = ax+by+cz$. Can anybody guide me? Also, does this apply in all dimensions?