简体   繁体   English

计算每个尺寸的两个3D矢量之间的角度

[英]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. 我知道如何计算两个向量之间的角度,就像这里建议的那样两个向量之间的角度matlab ,但是,我要做的只是获得一维的度数。 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°. 这样我就可以确定向量A和向量B在xy维度上是否具有例如30°的角度,但在yz维度上是否具有40°的角度。

Now I want to know how can I project a vector at the planes in MATLAB ? 现在我想知道如何在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. 例如,将2个向量投影到XY平面,实际上是使它们的“ z”等于零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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