首页 > 编程知识 正文

空间向量求夹角的公式,向量求和公式 已知夹角

时间:2023-05-06 07:10:44 阅读:21505 作者:650

I ' msorryifthisquestionseemsareallybasic,buticannotfindagoodansweronlineyet。

I ' malittleconfusedwithvectorsandhowtousetheminmatlab.atthemomentihavethefollowingthreepairofcooordinates (:个人1,tthemome

nowiwanttocalculatetheanglebetween ' thevectorwhichgoesfromperson1to person2' and ' thevectorfromperson1to person1future '.ini hiswiththevectors,butiamnotsureiamactuallyusingtherightinputforeachvector。

sonowmyquestionishowcaniusethesecoordinates (andthedifferencebetweenthem ) tocalculatetheanglefromtheimage?

althoughstefanm ' ssolutionisaprettycommonsolutiontothis,itisactuallycomputationallyexpensive,but most importantly, incorrectwhenthevectorsaretinyand/ortheangleisnear0or--itcanactuallyresultinanglesthatareslightlynegative,orslightlyexexynegate

Thus,it gives a false sense of robustness。

I'd instead suggest

theta=ACOS(min(1,max(-1,a ) a(a(: ).' *b ) : )/FZDBM(a )/FZDBM(a ) ) ) ) ) )

More robust,more correct,over 10 faster when run in a loop,andunderstandablebysdwdwithoutdocumentation,becauseitststillagresmes

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。