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