added algorithms for calculating top triangle for sierpinski gasket