Why are the two dot product definitions equal? I have an intuitive understanding of why $a\dot{}b=|a||b|\cos{\theta}$ geometrically. The projection of one vector onto another makes sense to me when explaining the origin of this geometric definition.
What I don't understand is why $a\dot{}b=a_xb_x + a_yb_y = |a||b|\cos{\theta}$. How does the algebraic version of the dot product connect to the geometric version? Can you derive the algebraic definition from the geometric? I read the answers to this question, but the proofs seem to depend on the actual algebraic definition to arrive at it.
My main question is, why are the two definitions really equal?
 A: First of all you can prove from the geometrical definition that distributive property holds for scalar product: $(\vec a+\vec b)\cdot\vec c=\vec a\cdot\vec c+\vec b\cdot\vec c$ (see diagram below for a sketch of the proof).

Then, you just have to decompose two vectors along an orthonormal coordinate system: $\vec a= a_x\vec i+a_y\vec j+a_z\vec k$,$\quad$ $\vec b= b_x\vec i+b_y\vec j+b_z\vec k$, and apply twice the distributive property, taking into account that $\vec i\cdot\vec i=\vec j\cdot\vec j=\vec k\cdot\vec k=1$
and $\vec i\cdot\vec j=\vec j\cdot\vec k=\vec k\cdot\vec i=0$:
$$
\vec a\cdot\vec b=
(a_x\vec i+a_y\vec j+a_z\vec k)\cdot(b_x\vec i+b_y\vec j+b_z\vec k)=
a_xb_x+a_yb_y+a_zb_z.
$$
A: Note that with $a$ and $b$ two sides of a triangle and $\theta$ the angle between them, the third side is $b-a$ and (cosine rule)  $$|b-a|^2=|a|^2+|b|^2-2|a||b|\cos \theta$$ so that $$2|a||b|\cos\theta=\Sigma a_i^2+\Sigma b_i^2-\Sigma (b_i-a_i)^2=2\Sigma a_ib_i$$ so that $$|a||b|\cos\theta=\Sigma a_ib_i$$ and the two definitions coincide. You can work the calculations backwards if necessary.
A: Assuming $a\cdot b = |a||b|\cos( \theta)$
and that $|a| = \sqrt{(x_1)^2 + (y_1)^2}$
and that $|b| = \sqrt{(x_2)^2 + (y_2)^2}$
Let $\gamma -\theta = \alpha$
For $\theta$ is the angle between the two vectors, $a$ and $b$, and not necessarily the angle between the 'outermost' line and say the x-axis.
Thus $\gamma$ is the angle between the outermost vector and the x-axis, whilst $\alpha$ is the angle between the other line and the x-axis.
Thus $\theta=\gamma-\alpha$ and more importantly by the trig identity: $\cos(a+b) = \cos(a)\cos(b)-\sin(a)\sin(b)$
$$\begin{equation}\begin{aligned}
a\cdot b &= |a||b|\cos(\theta)\\
&=|a||b|\cos(\gamma - \alpha)\\
&=|a||b|\biggl(\cos(\gamma)\cos(\alpha) - \sin(\gamma)\sin(\alpha)\biggl)\\
&=|a||b|\cos(\gamma)\cos(-\alpha) - |a||b|\sin(\gamma)\sin(-\alpha)\\
\end{aligned}\end{equation}\tag{1}$$
Then if $|a|$ was the outermost vector you realize that
$|a|\cos(\gamma) = (x_1)$, and that
$|a|\sin(\gamma) = (y_1)$
Making $|b|$ the innermost line, and that
$|b|\cos(-\alpha) = |b|\cos(\alpha) = (x_2)$, and that
$|b|\sin(-\alpha) = -|b|\sin(\alpha) = (-y_1)$
Because $\cos(-a) = \cos(a)$ and $\sin(-a) = -\sin(a)$
Plugging all that into 1 you get that $a\cdot b = (x_1)(x_2) - (y_1)(-y_2)$
And you finally get $a\cdot b = (x_1)(x_2) + (y_1)(y_2)$
A: Define A, B, C is vector, and a, b and c scale value (distance) of A,B,C 
define C=A-B, so A, B and C become a triangle
based on Law of cosines, c² = a² + b² - 2abcos(θ)
because c.c=C²
 C.C=A.A + B.B - 2abcos(θ)
because C = A - B
 C·C => (A -B)·(A - B) => (A·A - 2A·B + B·B)
so A·A - 2A·B + B·B=A.A + B.B - 2abcos(θ)
because A.A=A.A and B.B=B.B
=> - 2A·B B=- 2abcos(θ)
=> A.B=abcos(θ)
