The application of trigonometry to high-dimensional vectors in order to quantify correlation is not, to put it mildly, what the developers of the cosine had in mind. The Nicaean astronomer Hipparchus, who wrote down the first trigonometric tables in the second century BCE, was trying to compute the time lapse between eclipses; the vectors he dealt with described objects in the sky, and were solidly three-dimensional. But a mathematical tool that’s just right for one purpose tends to make itself useful again and again.