how can i determine angle between 2 variables
1 ビュー (過去 30 日間)
表示 古いコメント
how can i do/calculate the angle like in the ss below ,i know rBx,rBy and g

g=180/pi;
teta1=300;teta2=320;teta3=40;teta4=100;teta5=160; % in degrees
Alfa=deg2rad(teta1/g);aLfa=deg2rad(teta2/g); alFa=deg2rad(teta3/g);alfA=deg2rad(teta4/g);alfa=deg2rad(teta5/g);
rBx=-1*(r1*cos(Alfa)+r2*cos(aLfa)+r3*cos(alFa)+r4*cos(alfA)+r5*cos(alfa)+rAx)
rBy=-1*(r1*sin(Alfa)+r2*sin(aLfa)+r3*sin(alFa)+r4*sin(alfA)+r5*sin(alfa)+rAy)
2 件のコメント
回答 (1 件)
the cyclist
2021 年 1 月 5 日
You got the order of the inputs incorrect. It should be
atan2(rAy,rAx)*g
This will give a negative answer, measuring the angle "down" from the x-axis. If you add 360deg, you'll get the answer you want.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!