Original Post
I need a function to compute the angle formed by 3 points in 2D space. How does one calculate the interior angles of a simple polygon using only the X,Y vertices of the polygon...for example:
The vertices are 0,1,2,3,4,5,6 and each have an X,Y coordinate. Is there a way to calculate (for example) the interior angle at vertex 0 (a convex) knowing the X,Y coordinates of adjacent vertices 1, 0, and 6 ?
Same deal, how would I calculate (for example) the interior angle at vertex 5 (a reflex) knowing the X,Y coordinates of adjacent vertices 4, 5, and 6 ?
For a short report of what this is for, you can check
Implementation of the Hertel-Mehlhorn Algorithm
I actually need all the interior angles of a simple polygon in order to remove "inessential diagonals" created during a triangulation. Its a classic "Computational Geometry" problem, but not sure how to calculate the angles.
VazGames.com
Phil Porvaznik
The vertices are 0,1,2,3,4,5,6 and each have an X,Y coordinate. Is there a way to calculate (for example) the interior angle at vertex 0 (a convex) knowing the X,Y coordinates of adjacent vertices 1, 0, and 6 ?
Same deal, how would I calculate (for example) the interior angle at vertex 5 (a reflex) knowing the X,Y coordinates of adjacent vertices 4, 5, and 6 ?
For a short report of what this is for, you can check
Implementation of the Hertel-Mehlhorn Algorithm
I actually need all the interior angles of a simple polygon in order to remove "inessential diagonals" created during a triangulation. Its a classic "Computational Geometry" problem, but not sure how to calculate the angles.
VazGames.com
Phil Porvaznik