double getHeightRatio(double val) { double res = (val / refHeight) * 100; double temp = res * blockSizeVertical; return temp; }