Having 3 connected line segments, triangle is generally known 2d plane shape and it is a polygon. Square is a four sided regular polygon and a regular quadrilateral.
Polygon is a plane figure that is defined as finite number of straight line segments connected to form a closed chain.
Regular Polygon is a polygon with all angles are equal and all sides lengths are equal.
Input n – no. of sides and l – length of side
Polygons are differently named after no. of sides it has.
triangle – 3 sides
quadrilateral – 4 sides
pentagon – 5 sides
Hexagon – 6 sides
Heptagon – 7 sides
Octagon – 8 sides
Nonagon – 9 sides
Decagon – 10 sides
Formula for Total sum of internal angles
It is No. of sides subtracted by two is multiplied by 180 degrees.
( n – 2 ) x 180
Above formula derived by drawing minimum no. of triangles to fill the polygon area. The no. of triangles fit into a polygon is always two less than its side count. Then total internal angles of polygon becomes total internal angles of all triangles drawn within polygon. As we know the internal angles sum of any triangle is 180 degrees, So total internal angles of polygon is the given formula.