Well, basically what you need to do is apply the dot product. It is an easy process.First of all you make An element-wise multiplication of each vector. Let’s say you’ve got vector a and vector b. You multiply the x value of a times the x value of b. This must be done with all 3 elements (x y and z).Then you divide the sum of those three elements by the magnitude of both vectors. In other terms you divide the sum by IaIIbI.This will give you the cosine of the angle in between them.