rotate method

Vector rotate (
  1. num rads
)

Implementation

Vector rotate(num rads) {
  num s = sin(rads);
  num c = cos(rads);
  return Vector(x * c - y * s, x * s + y * c);
}