angle between three points please help

for f=1:h
t=(f-1)*k/20;
m=f+1;
P0=[171.5 239.5]; %střed [x,y]
P1=[htabulka(1,1),htabulka(1,2)]; %XY1 [x,y]
P2=[htabulka(f,1),htabulka(f,2)]; %XY2 [x,y]
ang = atan2(norm(det([P2-P0;P1-P0])),dot(P2-P0,P1-P0));
angst=ang*180/pi
cosf=cos(angst);
....
I have this part of code
I have a object rotating --> but this angle only gives me max 30 degrees but that is not posible becaouse the object is making circle
one point the center is always the same, than the beginning point is also the same, and one point is moving due to video --> so the degrees suposed to get from 0 to 360 but it gives me this

댓글 수: 3

ang = atan2(norm(det([P2-P0;P1-P0])),dot(P2-P0,P1-P0));
Could you show us where you got this strange formula from ?
Jeffrey Clark
Jeffrey Clark 2022년 11월 23일
Torsten
Torsten 2022년 11월 23일
The OP posted three different questions on the same subject.
This one was no longer used.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Identification에 대해 자세히 알아보기

태그

질문:

2022년 11월 22일

댓글:

2022년 11월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by