Simulation of reflection model using a sphere and a light source

euclidean-geometryreflectionsimulation

This is regarding a simulation of a reflection model using a sphere(in 2D) from the convex surface. I'm not being able to work out the geometry to calculate the angle between incident ray and the normal at the point of incidence. The center of the sphere and the light source are at the same height(y coordinate is same). The coordinates of the light source and center of sphere are known, and the initial angle is also known which the incident ray makes with the initial line joining the source and the center. Also, how should I set the limits such that the ray gets reflected off the surface itself(the x and y coordinates of the circle)? Can someone help me out in these? By the way, I'm using turtle graphics for the simulation in c++.

Best Answer

Reflection angle $\theta$ can be found from the sine rule:

$$ {r\over\sin\alpha}={d\over\sin\theta}, $$ where $d$ is the distance from the light source to the centre of the sphere, while $\alpha$ is the angle the incident ray makes with the line joining the source and the centre.

You can obtain the limiting value of $\alpha$ by setting $\sin\theta=1$ in the above formula.

enter image description here