three-dimensional vector angle calculation
if the vector is represented by coordinates, a=(x1,y1,z1), b=(x2,y2,z2), then, ab=(x1x2+y1y2+z1z2).
|a|=√(x1^2+y1^2+z1^2),|b|=√(x2^2+y2^2+z2^2)。
substituting these into formula (i), we get:
cos=(x1x2+y1y2+z1z2)/[√(x1^2+y1^2+z1^2)*√(x2^2+y2^2+z2^2)]。
the above formula is given in terms of three-dimensional coordinates in space. if z=0 in the coordinates, the calculation formula of the plane vector is obtained. the value range of the angle between two vectors is: [0,π].
when the included angle is an acute angle, cosθ>0; when the included angle is an obtuse angle, cosθ<0.