my problem is the following:
I have two points ($e$ and $p$) in a 2D space and I am trying to figure out where on the circle is the reflection of $p$ as seen from $e$.
$$$$
$$$$
So the way I approached this is by looking for the vector from the center of the circle to the point, where the ray is reflected.
[For simplicity the circle's center is located at $\color{darkturquoise}{(0,0)}$ and it has a radius with unit length. The two points are represented by the vectors $\color{deeppink}{e}$ and $\color{gold}{p}$]
In the picture were looking for the vector $\color{red}{r}$, which coincides with the normal vector of the surface of the circle. So this vector has to fulfill 2 properties:
- $||\color{red}{r}|| = 1$
- The angle between $\color{red}{r}$ and $\color{green}{p-r}$ should be equal to the angle between $\color{blue}{e-r}$ and $\color{red}{r}$.
The equation for the fist property is pretty straight forward. For the second property I came up with the following equation: $$\Bigg|\Bigg|\frac{\color{blue}{e-r}}{||\color{blue}{e-r}||}\times\color{red}{r}\Bigg|\Bigg| = \Bigg|\Bigg|\color{red}{r}\times\frac{\color{green}{p-r}}{||\color{green}{p-r}||}\Bigg|\Bigg|\\ \frac{||(\color{blue}{e-r})\times\color{red}{r}||}{||\color{blue}{e-r}||} =\frac{||\color{red}{r}\times(\color{green}{p-r})||}{||\color{green}{p-r}||}\\ \frac{1}{||\color{blue}{e-r}||}\Big|\Big|(\color{deeppink}{e}\times\color{red}{r})-\big((-\color{red}{r})\times\color{red}{r}\big)\Big|\Big|= \frac{1}{||\color{green}{p-r}||}\Big|\Big|(\color{red}{r}\times\color{gold}{p})-\big(\color{red}{r}\times(-\color{red}{r})\big)\Big|\Big|\\ \frac{||\color{deeppink}{e}\times\color{red}{r}||}{||\color{blue}{e-r}||}= \frac{||\color{red}{r}\times\color{gold}{p}||}{||\color{green}{p-r}||}\\ \frac{||\color{green}{p-r}||}{||\color{blue}{e-r}||}= \frac{||\color{red}{r}\times\color{gold}{p}||}{||\color{deeppink}{e}\times\color{red}{r}||}\\ \frac{\sqrt{1 + ||\color{deeppink}{e}||^{2} - 2(\color{red}{r}\cdot\color{pink}{e})}}{\sqrt{1 + ||\color{gold}{p}||^{2} - 2(\color{red}{r}\cdot\color{gold}{p})}}= \frac{||\color{red}{r}\times\color{gold}{p}||}{||\color{deeppink}{e}\times\color{red}{r}||} $$ After that I use the fact that the cross product of 2 2D-Vectors has a single non-zero value and it determines the length of that cross product. $$ \frac{\sqrt{1 + ||\color{deeppink}{e}||^{2} - 2(\color{red}{r}_{1}\color{pink}{e}_{1} + \color{red}{r}_{2}\color{pink}{e}_{2})}}{\sqrt{1 + ||\color{gold}{p}||^{2} - 2(\color{red}{r}_{1}\color{gold}{p}_{1} + \color{red}{r}_{2}\color{gold}{p}_{2})}}= \frac{\color{red}{r}_{1}\color{gold}{p}_{2}-\color{red}{r}_{2}\color{gold}{p}_{1}}{\color{deeppink}{e}_{1}\color{red}{r}_{2}-\color{deeppink}{e}_{2}\color{red}{r}_{1}} $$ The left hand side is positive. I want both angles to have equal signs, because they are both in the same general direction as $\color{red}{r}$. This means that the right hand side is also positive. I square both sides to get rid of the roots on the left. $$ \frac{1 + ||\color{deeppink}{e}||^{2} - 2(\color{red}{r}_{1}\color{deeppink}{e}_{1} + \color{red}{r}_{2}\color{pink}{e}_{2})}{1 + ||\color{gold}{p}||^{2} - 2(\color{red}{r}_{1}\color{gold}{p}_{1} + \color{red}{r}_{2}\color{gold}{p}_{2})}= \frac{(\color{red}{r}_{1}\color{gold}{p}_{2}-\color{red}{r}_{2}\color{gold}{p}_{1})^{2}}{(\color{deeppink}{e}_{1}\color{red}{r}_{2}-\color{deeppink}{e}_{2}\color{red}{r}_{1})^{2}} $$ And this is as far as I can get. I don't think substituting $p_{2}$ with $\sqrt{1-p_{1}^2}$ will get me anywhere and also avoid it, since I am going to use that in a graphic application and I am trying to make as few calculations as possible.$$$$ Hope I explained the problem well enough and followed all conventions on this forum :) This is my first post here, so I accept any critique on it.