Vector normalize()

Source

Vector normalize() {
  num nf = 1 / length;
  return new Vector(x * nf, y * nf);
}