how can i determine angle between 2 variables
3 次查看(过去 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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Array and Matrix Mathematics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!