Find the sum of the interior angles of a polygon

  Kiến thức lập trình

I have coordinates of points (x, y). By connecting these points we get a polygon in which I have to calculate the sum of its internal angles.

For example
points = [[3,1], [3,3], [1,3], [3,5], [7,5], [7,1]]

So, to get the sum of all the interior angles of a polygon, I have to add: 90 + 270 + 45 + 135 + 90 + 90 = 720

I repeat, I only have coordinates. Please tell me how to find out the angles between the lines.

In the picture I have given a rather simple example. In reality my polygons will not be so straight, but for example

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT