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!