TITLE: History of dot product and cosine
QUESTION [26 upvotes]: 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?

REPLY [3 votes]: Cross-posted my answer here.
It is Sir William R. Hamilton who originally touched upon the concept. Near the end of his letter to John T. Graves about his recent discovery of quaternions in the same year (1843), he writes the following:

Multiplication will be easy if we are familiar with the rules for the product of two pure imaginaries. This product is, by (B.),
$$(0, b, c, d)(0, b′, c′, d′) = (−bb′ − cc′ − dd′, cd′ − dc′, db′ − bd′, bc′ − cb′);$$
the product-line is perpendicular to the plane of the factors; its length is the product of their lengths multiplied by the sine of the angle between them: and the real part of the product, with its sign changed, is the same product of the lengths of the factors multiplied by the cosine of their inclination.

In essence, he recognized that (using modern notation for quaternions):
$$(0, \vec{v})(0, \vec{w}) = (-\Vert \vec{v} \Vert \Vert \vec{w} \Vert \cos(\theta), \Vert \vec{v} \Vert \Vert \vec{w} \Vert \sin(\theta) \vec{k})$$
where $\theta$ is the angle between $\vec{v}$ and $\vec{w}$, and $\vec{k}$ is perpendicular to $\vec{v}$ and $\vec{w}$.
This discovery precedes Gibbs and Heaviside, who were born in 1839 and 1850 respectively.