Cosine Similarity Calculator

Whether you are estimating on the spot or checking a result somebody else gave you, the cosine similarity calculator is the quickest way to get from a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, one way and vector length (dimension) to mag a10, mag b10 and mag a2.

What Is the Cosine Similarity Calculator?

The cosine similarity calculator works through a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, one way and vector length (dimension) to give you mag a10, mag b10 and mag a2.

It is aimed at the case where you know the method but not the arithmetic: schoolwork, a quick check on a worked example, or a figure that needs to be right first time.

How the Cosine Similarity Works

Each step is applied in order and depends only on the values before it, which makes it possible to follow the calculation rather than take it on trust.

If you are working through the same problem by hand afterwards, compare the intermediate values. That is where a mistake usually shows itself.

Checking Your Own Working

Round sensibly as you go and keep the full precision in the calculator. Rounding too early is the most common way of getting a right method to give a wrong answer.

Where a result should be a whole number, such as a count, check it against the constraint that produced it. A fraction of a person is a sign that something upstream needs revisiting.

A Worked Example

Working through an example, with a1 set to 10, a2 set to 5, a3 set to 2, the calculator returns mag a2 of 125, and mag a3 of 129, and mag a4 of 10,129. Substitute your own figures and the same steps produce the same kind of answer.

Frequently Asked Questions

What do I need to work out mag a10?

Enter a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, one way and vector length (dimension). The calculator then works through the relationship and reports mag a10, mag b10 and mag a2.

What does the cosine similarity actually calculate?

It takes a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, one way and vector length (dimension) and converts them into mag a10, mag b10 and mag a2 using the standard relationship for this problem. Each step is applied in turn, so every output is traceable back to the numbers you typed in.

How should I enter a1?

Use the value you actually have, in the unit shown next to the field. Enter every value in the same unit system. The calculator assumes the figures you supply are consistent, so it cannot correct a mistake that happens before the calculation starts.

Do I have to fill in every field?

Only the fields a particular result depends on. If you leave one blank, the results that need it simply show a note instead of a number, and everything else still works.

Why does a small change in one value move the answer so much?

That happens when an output depends on a ratio, because dividing by a small number magnifies any change in it. Check the units first, then check whether the value you entered is in the range the relationship was designed for.

Scroll to Top