Originally Posted by PJYelton
Actually the graphic method would be more versitle. The limit of my version, is the mountain cant be converse. The equations of the lines have to be function (pass vertical line test). IF you did it graphic wise, testing and changing pixels, it would allow you to have converse shapes. Also you would be able to avoid costly math operations. I only proposed my way as it is very "mathmatical" in solution.