The applet shows the problem with intersections.
P1 : Point in -0.39755351681957185, 0.3883792048929665 P2 : Point in 0.4036697247706422, -0.38837920489296635 g1 : Line through P1 and P2 P : Point in 0.345565749235474, 0.31804281345565755 L1 : Prependicular through P to g1 S1 : Intersection of g1 und L1 K1 : Circle around S1 through P S2 : Intersection of L1 and K1 S3 : Intersection of L1 and K1
It is clear that any of the points 2/3 may be the reflexion point. But one of them is equal to P. So define the other to be different from P all the time. This will make this construction work for any arrangement of P.