Would be nicer if the polygon pts array contained just the shape data and let the fillPolygon set where it's drawn.
So you could define a shape like this...
var arrow = [ [1,1], [1,10], [10,5] ];
Then have it drawn at a certain location, for example,
fillPolygon(arrow, 10, 10)
i.e. draw the arrow polygon at 10,10.
Cool eh?! ;-)