Oh, my mistake, I am very tired.
The road has two lanes, left and right.
I can create a road with two points, like this: a-------------------------------b
The line which is created by the points a and b is midle of the road.
Now, I have the point c which is the car în my program.
Initial the point is on the line a-----------------c----------------b
If direction of the car (point c) is a->b I whant to put the car in the right lane, and if the direction of the car is b->a I want to put the car in the left lane.
Like this:
a->b -----------------------------------
c
a<-b
c
a<-b -----------------------------------
I know how to put the car on the correct lane, but I don't know when to do it
I was thinking about the direction, and to put every time a point to right side of the direction of two points, so my car will be all time on the correct lane of road