Reflection of line on a sphere.

376 Views Asked by At

How do I calculate the reflection of a line on a sphere in 3D? I.e. given the situation shown below, how do I calculate the vector w?

enter image description here

Where C is the center of the sphere, v is the direction of the line and w is the direction of the reflected line.

1

There are 1 best solutions below

5
On BEST ANSWER

Note that $w$ is the reflection of $v$ in the line $\overline{xc}$, so simply take $$w=2\langle v,x-c\rangle(x-c)-v.$$