reflect method

V2 reflect(
  1. V2 normal
)

Implementation

V2 reflect(V2 normal) {
  double dot = dotProduct(normal);
  return _v2(
    x - (2.0*normal.x)*dot,
    y - (2.0*normal.y)*dot,
  );
}