Let [tex]\vec{a},\vec{b} \text{and}, \vec{c}[/tex] be three vectors which represent sides of Triangle.
Using triangle law, that is for a closed path the sum of three vectors will be zero.
[tex]\rightarrow \vec{a}+\vec{b}+\vec{c}=0\\\\\rightarrow \vec{a}+\vec{b}= -\vec{c}\\\\ \text{Squaring both sides}\\\\ \rightarrow(\vec{a}+\vec{b})^2=(-\vec{c})^2\\\\ \rightarrow\vec{a}^2+\vec{b}^2+2*\vec{a}*\vec{b}*\cos C=\vec{c}^2[/tex]
Which is Cosine law that is "Law of Cosines" for a Triangle.
If two vectors are Orthogonal, that is vector a and vector b, then their dot product will be Zero.
[tex]\vec{a}.\vec{b}=|\vec{a}|*|\vec{b}|*\cos 90^{\circ}\\\\\vec{a}.\vec{b}=0[/tex]
So, Law of Cosine Reduces to
[tex]\rightarrow\vec{a}^2+\vec{b}^2+2*0=\vec{c}^2\\\\\rightarrow\vec{a}^2+\vec{b}^2=\vec {c}^2[/tex]
Which is the Pythagorean Theorem, where a and b are smaller sides of triangle and,c, is the Hypotenuse of Right Triangle.