Calculations for positioning.