shortened code for direction() in case of a null vector