2D top down racing, car off the track?

Hi,
Can someone tell me how to calculate/figure out when the car is off the track (so that i can slow it down)?
Can you refer to some tutorials?
Thanks and regards