Traditional Culture Encyclopedia - Traditional culture - How to find the rotation angle between two vectors in space? The angle range is 0-360 degrees.

How to find the rotation angle between two vectors in space? The angle range is 0-360 degrees.

Let two vectors be: vector OA=(x 1, y 1, z 1), vector OB=(x2, y2, z2), and the included angle between them is m.

Then: vector OA* vector ob = x1x 2+y1y2+z1z 2.

And: vector OA* vector OB=|OA|*|OB|cosm.

=((x 1^2+y 1^2+z 1^2)(x2^2+y2^2+z2^2))^( 1/2)*cosm

cosm=(x 1x2+y 1y2+z 1z2)/((x 1^2+y 1^2+z 1^2)(x2^2+y2^2+z2^2))^( 1/2)

m=arccos((x 1x2+y 1y2+z 1z2)/((x 1^2+y 1^2+z 1^2)(x2^2+y2^2+z2^2))^( 1/2))