This is very strange. You title this "octagon" and the first word is "octagon" buy you ask about a "heptagon"?

In any case, imagine drawing lines from some point in the middle of the polygon to each vertex. For a polygon with n sides that creates n triangles. Since the angles in a triangle total 180 degrees (\(\displaystyle \pi\) radians) the n triangles have total angles of 180 n degrees (\(\displaystyle n\pi\) radians. **However** the angles at the central point total 360 degrees \(\displaystyle (\(\displaystyle 2\pi\) radians) so the measures of the angles of the polygon itself total 180n- 360 degrees (\(\displaystyle n\pi- 2\pi= (n- 2)\pi\) radians). For example, when n= 3 that is of course 3(180)- 360= 180 degrees (\(\displaystyle (3- 2)\pi= \pi\) radians) or when n= 4, that is 4(180)- 360= 360 degrees (\(\displaystyle (4- 2)\pi= 2\pi\) radians).\)