I bumped into something funny while I was trying to run a little VB script.
I don't know VB script to good so I don't know if there is a better way but I calculated the Angle between two Vectors like this :
when dealing with floating point numbers note that they may carry noise in the low digits. If you type 1.0 as a constant it will be proper, but if 1.0 is the result of an expression, it may well be 0.999999999999984 or 1.000000000000013. Acos is only defined for the strict -1 to +1 range, so if your noise nudges the number just over the 1.0 boundary, you'll get a NaN.
If you're dealing with ACos and you're liable to get numbers slighty over 1.0, I recommend adding a clipping operation prior to the ACos: