Example from this thread
Using atan2 is more robust for very small angels:
a = 1e-10
u = 4*np.array([1,0,0])
v = np.array([math.cos(a), math.sin(a), 0])*5
math.acos(np.dot(u,v)/(np.linalg.norm(u)*np.linalg.norm(v)))
math.atan2(np.linalg.norm(np.cross(u,v)),np.dot(u,v))