简体   繁体   中英

Calculate the angle between two 3D vectors for each dimension

I know how to calculate the angle between two vectors, like suggested here Angle between two vectors matlab , however, what do I have to do to only get the degree in one dimension. So that I can tell if vector A and vector B have an angle of for example 30° in the xy-dimension, but in the yz-dimension an angle of 40°.

Now I want to know how can I project a vector at the planes in MATLAB ? After this I should be able to calculate the angle the same way it is done in the provided link

While I really really think that its likely you are making some mistake in your maths, prior to this, the solution to your problem is easy.

Projecting the vectors to a Cartesian plane is simple removing that coordinate that doesn belong. Eg projecting 2 vectors to XY plane, is essentially making their "z" to be equal to zero.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM