Add computation of direction vectors