calculateHeight function

Calculate Peak Height.