I am currently working on a project which involves using a set of coordinates to control a car. At the moment, these waypoints are input into an array of x and y and the car is commanded to traverse the line between them.
The problem i have is I cannot work out how, given 3 points, A (being the previous waypoint), B (being the waypoint the car is approaching) and C (being the next waypoint the car will be travelling towards after it has turned) I can calculate whether the car is turning right or left at B.
It might be easier to do all that using complex numbers (RE,IM) instead of number pairs (X,Y). You can get the difference in vector angle, which you then need to fold into a unique range (e.g. 0..360 or -180..180). Half of the range is "right", and the other half is "left".
See how far you get. 😉
Or you calc the difference of theta...