move function

Determine the new position when moving from the current position in a given direction