MATLAB: To calculate the angles of the Delaunay triangles

delaunaymathematicsmatlab mathematics toolbox

I am trying to calculate the 3 angles of each triangle generated by Delaunay triangulation. For example, I have already obtained the area and the perimeter of each triangle. But I also wanna calculate the angles of each triangle. Anyone help?

Best Answer

If P1, P2, and P3 are coordinates of the three vertices of a triangle, and A is its area, its angle at P1 can be calculated as:
a1 = atan2(2*A,dot(P2-P1,P3-P1)); % <-- Corrected
and similarly for the other two angles.