math - How would you calculate the sum of interior angles from a SVG path? -
for example, path 1 below:
<path d="m 35 50 l 35 35 l 90 90 z" fill="goldenrod"/>
if contour closed (z-command) , simple polygon, sum of interior angles is
sa = 180 * (n - 2)
where n number of vertices.
here 3 vertices, sa = 180
(it works concave polygons, not self-intesecting ones (they 'not simple'))
Comments
Post a Comment