function f = draw_car(state, line_specs, P)

frame = vehicle_frame(state, P);

car = P.cars(state.id);

% car geometry: polygon defined by body-frame vertices
l = car.length;
w = car.width;
x = 0;
y = 0;
car_poly = [x-l/2 x+l/2 x+l/2 x-l/2 x-l/2;
y-w/2 y-w/2 y+w/2 y+w/2 y-w/2;
1 1 1 1 1];

points_road = frame*car_poly;

plot(points_road(1,:), points_road(2,:), line_specs, 'LineWidth', 2);
hold on
dir = frame*[0 car.length/2;
0 0;
1 1];
plot(dir(1,:), dir(2,:), line_specs);

text(mean(points_road(1,:)), mean(points_road(2,:)), num2str(state.id));