Here's a quick proof as to how it works. Suppose the triangle has endpoints (0,0), (1,0), and (1/2, sqrt(3)/2). Given a point (x,y), the three transformations then become<p>f1(x,y) = (x/2, y/2)<p>f2(x,y) = (x/2+1/2, y/2)<p>f3(x,y) = (x/2 + 1/4, y/2 + sqrt(3)/4)<p>which are precisely the maps in the Iterated Function System [1] which generate the Sierpinsky triangle!<p>It's a very nice observation that the three maps have a concise representation in terms of taking the midpoint with the given point and the vertices of the triangle.<p>[1] <a href="https://en.wikipedia.org/wiki/Iterated_function_system" rel="nofollow">https://en.wikipedia.org/wiki/Iterated_function_system</a>