theDirection.scalarMult(arrowLength);
perp.scalarMult(arrowWidth);
// Create a polygon.
shape.reset();
shape.moveTo(x, y);
shape.lineTo(x - theDirection.data[0] + perp.data[0], y
- theDirection.data[1] + perp.data[1]);
shape.lineTo(x - theDirection.data[0] - perp.data[0], y
- theDirection.data[1] - perp.data[1]);