It is calculated by taking the percentage change in the quantity demanded of one good and dividing it by the percentage change in the price of the other good.
Hence we; 30/20 = 1.5