Here is a 2D version. The points where the light rays intersect the mirror are calculated so that the angle of incidence and the angle of reflection are equal.



Here is a 3D version. The points where the light rays intersect the mirror are calculated so that the angle of incidence and the angle of reflection are equal.