function rotateVector(vector, angle) {
  return (!angle) ? vector : {
    x: Math.cos(angle) * vector.x - Math.sin(angle) * vector.y,
    y: Math.sin(angle) * vector.x + Math.cos(angle) * vector.y
  };
}
Rotates a vector by a given angle.

@param {Vector} vector
@param {number} angle The angle in radians.

@return {Vector}