This is a nice problem for beginners to programming. In the video, it implements a basic ray casting engine with line segment “surfaces” and vector “rays.” The result simulates a light source casting shadows in a 2D canvas.
https://thecodingtrain.com/CodingChallenges/145-2d-ray-casting.html