# Find Normal from Reflection

I have a vector A with direction $\vec D$.

I also have another vector B with direction $\vec R$.

(think of $\vec R$ to be the reflection of $\vec D$ at point B.)

From the reflection formula:$$\vec R = \vec D-2*(\vec D \cdot \vec N)*\vec N$$ (we know both $\vec R$ and $\vec D$)

How can I find $\vec N$?

• Do you understand how the reflection formula was derived? That should give you a clue. – amd Dec 10 '15 at 19:34

## 2 Answers

The reflection formula says that to reflect a vector $\mathbf v$ in the hyperplane specified by its normal $\mathbf n$, you reverse the component of $\mathbf v$ that’s in the direction of $\mathbf n$. That is, you decompose $\mathbf v$ into $\pi_{\mathbf n}\mathbf v+(\mathbf v-\pi_{\mathbf n}\mathbf v)$, where $\pi_{\mathbf n}$ is orthogonal projection onto $\mathbf n$, and then negate the first component: $$\mathbf v'=-\pi_{\mathbf n}\mathbf v+(\mathbf v-\pi_{\mathbf n}\mathbf v)=\mathbf v-2\pi_{\mathbf n}\mathbf v.$$ To recover the normal given $\mathbf v$ and $\mathbf v'$, remember that $\pi_{\mathbf n}\mathbf v$ is a scalar multiple of $\mathbf n$, so $\mathbf v-\mathbf v'=2\pi_{\mathbf n}\mathbf v$ is a multiple of $\mathbf n$ and is also normal to the hyperplane.

Without more information about $\mathbf n$ and its relationship to $\mathbf v$, that’s the best you can do. If $\mathbf n$ was a unit vector, you can normalize $\mathbf v-\mathbf v'$, but that gives you $\pm\mathbf n$. To resolve the sign ambiguity you’ll need to know if $\mathbf v$ is on the same side of the hyperplane as the original normal.

• $\vec D$ and $\vec R$ are both unit vectors (normalized). I forgot to mention that in my question, sorry. – Constantinos Glynos Dec 11 '15 at 16:05

I think I solved it but I'm still looking for a better answer: $$\vec R = \vec D-2*(\vec D \cdot \vec N)*\vec N$$ $$\vec N = -\frac{(\vec R - \vec D)}{2*(\|\vec D\|*\|\vec N\|*cos\theta)}$$ where $\|\vec N\|$ is equal to 1.

• You’re on the right track, but not quite there yet. You’ve got $\cos\theta$ in the denominator, which is a function of $\vec N$, so you’ve still got an $\vec N$ on both sides of the equality. – amd Dec 10 '15 at 21:07
• But I can find $cos \theta$ because I already know $\vec D$ and $\vec B$. I don't think it has anything to do with the normal of the hyperplane. Then I plug that $\theta$ into the Reflection formula and solve for $\vec N$. – Constantinos Glynos Dec 11 '15 at 9:37
• This angle in the reflection formula is between $\vec D$ and $\vec N$—that term is their inner product—but you’re right that you could compute it if you know $\vec D$ and $\vec B$. The hyperplane of reflection bisects the angle between them and the normal is normal to that, so it’s something like $\frac\pi2-\frac12\angle\vec D\vec B$. However, there’s no need to calculate angles and their cosines at all if you understand what the reflection formula means. – amd Dec 11 '15 at 9:54
• yes I see what you mean! my original method was not accurate! Thnx! – Constantinos Glynos Dec 11 '15 at 15:53