Solution (source code)

= Solution

Let the initial <velocity> be $\mathbf v$ and the two final <velocities> be $\mathbf u,\mathbf w$. In the stated nonrelativistic <elastic collision>, <conservation of momentum> and <conservation of energy> give
$$
\mathbf v=\mathbf u+\mathbf w,\qquad
v^2=u^2+w^2.
$$
Squaring the first equation and comparing it with the second yields
$$
v^2=u^2+w^2+2\mathbf u\cdot\mathbf w,
\qquad \boxed{\mathbf u\cdot\mathbf w=0.}
$$
If both final <velocities> are nonzero, their directions are perpendicular. If one is zero, the moving particle retains the initial <velocity> and a scattering angle for the stationary particle is undefined. This includes the zero-deflection and head-on exchange limits rather than incorrectly assigning a direction to a zero vector. Equal <masses> and a stationary initial target are essential to the dot-product cancellation.