reflect method

Vector reflect (
  1. Vector normal
)

Implementation

Vector reflect(Vector normal) {
  var d = 2 * (x * normal.x + y * normal.y);
  return Vector(x - d * normal.x, y - d * normal.y);
}