Use angleReflect()
from Geometric.js to calculate the angle of reflection given an angle of incidence and a surface angle.
The blue line represents the angle of incidence, the purple line the angle of reflection, and the black line the surface. You can change the angle of incidence by draggin the blue circle, and the angle of the surface by dragging the black circle.
https://d3js.org/d3.v5.min.js
https://unpkg.com/geometric@1.0.6/build/geometric.js