Tilings of polygons with similar triangles

We prove that if a polygonP is decomposed into finitely many similar triangles then the tangents of the angles of these triangles are algebraic over the field generated by the coordinates of the vertices ofP. IfP is a rectangle then, apart from four “sporadic” cases, the triangles of the decomposition must be right triangles. Three of these “sporadic” triangles tile the square. In any other decomposition of the square into similar triangles, the decomposition consists of right triangles with an acute angleα such that tanα is a totally positive algebraic number. Most of the proofs are based on the following general theorem: if a convex polygonP is decomposed into finitely many triangles (not necessarily similar) then the coordinate system can be chosen in such a way that the coordinates of the vertices ofP belong to the field generated by the cotangents of the angles of the triangles in the decomposition.