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); These types of methods are known as predicates in the field of computational geometry. In particular, this one is known as **is_left(segment s, point p)** or equivalently **is_right(segment s, point p)**.