Angle betwen an edge and a geodesic line, which are both members of the same mesh?
Show older comments
Hi there,
The coordinates of all three vertices are of course known. I have Boost libraray installed but I'm unaware of such function. Any suggestions?
Accepted Answer
More Answers (1)
Roger Stafford
on 24 Jun 2013
If the three vertices you refer to are column vector vertices, P1, P2, and P3, of a triangle, and you want to find the inner angle at P1, do this:
a = atan2(norm(cross(P2-P1,P3-P1)),dot(P2-P1,P3-P1));
or if you are in two-dimensional space
a = atan2(abs(det([P2-P1,P3-P1])),dot(P2-P1,P3-P1));
The angle is returned in radians ranging from 0 to pi.
Categories
Find more on Triangulations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!