For problems were only a direction is needed: You can ask for any vector in the given direction. Vectors in the opposite direction can be allowed or not. The algorithm works in any dimension.