Normalise, then read the angle off
The dot product has two faces, so set them equal: . Everything in that sentence is known except , so solve for it: , read aloud theta equals inverse cos of a dot b over the magnitude of a times the magnitude of b. Three ingredients, and this lesson makes you cook all three: the dot product on top, and BOTH magnitudes multiplied underneath.
Dividing by the two lengths is called normalising, and it is the step that makes the answer depend on direction alone: double either arrow and the top and bottom double together, leaving untouched — exactly as geometry demands. The ratio therefore always lands between and ; if yours does not, the arithmetic broke upstream, and no amount of retyping will fix it. One more mercy: unlike the direction angle, this one has no quadrant problem. The angle between two vectors is defined from to , and returns exactly that range and nothing else.