add getRelativeDirection to avoid bad configurations
new function