Calcuate y coordinate from bottom.