you could multiply to the formula the sign of the z component from the resulting cross product of two vectors v, w.
given segment s with points s1,s2 you compute.
v = vector from s1 to car_pos.
w = vector from s1 to s2.
if the z component of the resulting vector r = v x w is positive then car is on the right, otherwise (z negative) the car is on the left. In practice you just need to compute the following:
float rz = v.x * w.y - w.x * v.y; return (rz > 0); This isThese types of methods are known as predicates in the field of computational geometry. This one inIn particular, this one is normally calledknown as is_left(segment s, point p) or equivalently is_right(segment s, point p).