I know that this question has been up before, but I'll give it a shot since it's not exactly the same question.
Imagine a straight line consisting of a start point and an end point. The orientation of the line in 2D can be whatever we choose. Now imagine that we are traveling along this line, but not exactly on the line. I would like to give the directional (e.g right, left) feedback so that they know what direction to head to stay on the line.
I've been reading and trying this solution: Calculate on which side of a straight line is a given point located?
I'm currently stuck when trying to grasp what happens if we travel in the opposite direction.. I's there a solution that will always give us the correct direction? No matter the line's orientation and our traveling direction. I have the possibility to place one or more reference points in the plane that are known.