displacement calculation formula