Asked by Mahan Soltani
on 1 Jan 2013

hi, how can i caculate degree between 3 points? i have position of X and Y of this three points. for more information please see this picture ( http://theme.tk/wp-content/uploads/2013/01/Untitled1.png ) and download this file ( http://theme.tk/wp-content/uploads/2013/01/data.zip ).

Answer by Roger Stafford
on 1 Jan 2013

Let row vectors P0 = [x0,y0], P1 = [x1,y1], and P2 = [x2,y2] be Calcaneus, L-Knee, and 2th_MT points, respectively. The angle shown in red in radians at Calcaneus point is:

ang = atan2(abs(det([P2-P0;P1-P0])),dot(P2-P0,P1-P0));

Multiply by 180/pi to get degrees.

Roger Stafford

Show 7 older comments

Mahan Soltani
on 1 Jan 2013

Roger Stafford
on 1 Jan 2013

Mahan Soltani
on 2 Jan 2013

Answer by Image Analyst
on 1 Jan 2013

Check out this link:

http://www.mathworks.com/matlabcentral/answers/11580#answer_15786

Mahan Soltani
on 1 Jan 2013

Image Analyst
on 1 Jan 2013

Related Content

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 2 Comments

## Azzi Abdelmalek (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/57736#comment_120074

In your image there are 4 points? Can you be more clear by giving an example of coordinates

## Mahan Soltani (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/57736#comment_120075

yes,but i need degree that is red and (?degree). degree between two line(L-Knee point & Calcaneus) and (Calcaneus & 2th_MT). this image is a motion analys that i need degree of Ankle. some of data is : ( http://theme.tk/wp-content/uploads/2013/01/data-1.zip ) .