0 = freeze the wall
vector reflection (bounce) — live canvas animation example
motion & easing8+
trig, angles & vectors8-
collision detection11+
numbers in motion7+
geometry & shapes8+
generative showpieces13+
handy helpers7+
vecReflect uses the surface normal (green dashed), not the wall direction itself, to compute that ricochet. Rotate or freeze the wall and you can see the same incoming motion bounce to a different outgoing angle.