>>1
The sum of the outer angles of an arbitrary convex n-sided polygon have to add up to 360. The inner and outer angle of a vertex together sum to 180, so the sum of the inner and outer angles is simply 180*n. Hence the sum of the inner angles is 180*n-360.
For a triangle, n=3, so 180*3-360 = 180.
That's also why for an arbitrary convex quadrilateral (such as a rectangle or trapezoid), the inner angles add up to 360.