Why did I feel like crap after racing against a car? I raced against a car yesterday for fun, in doing this, I rode at about 25-29 mph (40-47kmh) for about 3 minutes. The temperature outside was in the mid to low 40s (5-8 Celsius).

Afterwards I felt:


Out of breath for at least 3 minutes
Wanted to cough but didn't cough anything up. 
Inside of my throat felt cold and painful
I got the feeling of wanting to puke a few times


For the rest of my commute home, which was 15+ minutes I felt like shit. 

I think that the cold weather was big factor in this, am I correct? What can I do in the future to prevent this from happening to me? During the 3 minutes of the ride I had no idea that I was going to feel this way. 

I should add that I've been riding 10 miles per day for the 2 years (including most of the winter). I usually ride this same stretch going 21-26 mph.
Breathing in the cold air probably didn't help, but what you describe happens to most people after doing hard intervals and only goes away with recovering.  As far as preventing it in the future, the only thing I can recommend is not maxing out and going anaerobic by chasing cars and going into zone 4/5 heart rate.

Edit for Clarification

When I refer to going anaerobic that means going above your Lactic Threshold. During the sprint after the car you were in that zone for a long period of time.  This is also referred to as Heart Rate Zone 4 or 5 depending on intensity. Those zones are used for high intensity training and can't be maintained for a long period of time.  Since your heart rate lags behind exertion you won't feel it right away, but you will after racing the car.  When you are riding on your own, you aren't pushing as hard as you were when you were chasing the car (think dogs chasing after a rabbit) which is why you wouldn't have felt it before.