# History of dot product and cosine

The fact that the dot product and the cosine of the angle between two vectors are mutually computable is easy to show (see the two sides in the two answers at Dot product in coordinates).

But looking at the dot product, I would never have thought that it somehow captures something about the angle (and vice versa).

How did the connection get discovered? Who were the major players? Did it just fall out of the development of matrix operations for linear algebra (or did the dot product come first) or are these only related by hindsight or what?

-
Very nice question! I'm eager to learn the answer. Hope, somebody can come up with an idea. – Torbjörn Apr 27 '11 at 16:10
I'm far away from my copy of Crowe's book, but I believe the notion of both the dot and cross products developed from the notion of multiplying two quaternions. – J. M. Apr 27 '11 at 16:12
I don't know the answer, but addressing the "I would never have thought..." part: If you look at the length of $\vec v-\vec w$ in terms of the dot product and distribute, you get $\|\vec v-\vec w\|^2 = \|\vec v\|^2 + \|\vec w\|^2 - 2\vec v\cdot\vec w$. This is reminiscent of the Law of Cosines. If you look at the triangle with lengths $\|v\|$, $\|w\|$, and $\|v-w\|$ and apply the Law of Cosines with the angle between $v$ and $w$, all the squared lengths cancel right away to give the result. To me it seems natural enough that you or I could have "discovered" it (after the fact). – Jonas Meyer Apr 27 '11 at 18:36
@Jonas: that sounds 'answerish' (actually, the easiest derivation of the dot-product/cosine connection is through the law of cosines. – Mitch Apr 27 '11 at 18:54
i think you need the cauchy-schwarz-bunyakowsky inequality $|u.v| \le |u||v|.$ so that $u.v$ can be written as $|u||v|\cos (\theta)$ for some $\theta.$ that this $\theta$ is the angle between the vectors $u,v$ in $R^n$ is fortunate? – abel Apr 27 '11 at 20:19

I suspect that J.M. is right: historically, quaternions came before vectors. But before the quaternions you had complex numbers.

For two complex numbers $z$ and $w$, the fact that $\text{Re}(\overline{z} w) = |z| |w| \cos \theta$, where $\theta$ is the angle between them measured at the origin, is clear from the polar representation. Write this out in terms of the real and imaginary parts of $z$ and $w$ and you have the two-dimensional version of your relationship.

Hamilton, of course, knew all of this, and a main motivation behind his development of the algebra of quaternions was to get a way to study three-dimensional space analogous to the use of complex numbers to study two-dimensional space. If $P = a i + b j + c k$ and $Q = d i + e j + f k$ are quaternions representing what we would call "vectors", the real part of the quaternion $\overline{P} Q = (-ai-bj-ck)(di+ej+fk)$ is $ad + be + cf$, and this should be (and is) $|P| |Q| \cos \theta$.

Gibbs et al dispensed with the quaternion framework and wrote this as the "dot product" of the two vectors $(a,b,c)$ and $(d,e,f)$.

-
The dot product as an explicit algebraic operation is not so necessary to the 'dischord of appearances', it is the $a d + b e + c f$ a decidedly open calculation in comparison to the obscurantist length of a vector and angle formula (requiring much more machinery). Any idea if this (what Hamilton knew) was popular before Gibbs? – Mitch Apr 25 '12 at 19:25
Can you show that the real part of the quaternion is |P||Q|cosθ, analogous to complex numbers in two-dimensional place, please? – Dave Clifford Jan 27 '14 at 21:42

Looking at mathword under D you'll find:

DOT PRODUCT is found in 1901 in Vector Analysis by J. Willard Gibbs and Edwin Bidwell Wilson:

The direct product is denoted by writing the two vectors with a dot between them as

A·B

This is read A dot B and therefore may often be called the dot product instead of the direct product.

[This citation was provided by Joanne M. Despres of Merriam-Webster Inc.]

If you get a hold of a copy I'm sure they'll have a good discussion on the matter. Gibbs was the big proponent of vectors and I'm willing to bet he'd have discussed the connection between the two. That'd probably be a good starting point to tracking down an answer to your question.

-