Find the riser heights for clean line of sights

I would need advice,

with a bit of geometry I tried to find the right heights to have a clean line of sight from each eye point to the point P.
To do this, I have to create its own script for each single point, based on the previous “point” (see attached gh-File). I wanted to ask if there was a method to automate the whole process, starting from point P and from a list of points for the position of the seats. (26.2 KB)

Thanks in advance

Line-of-Sight Edited V0 (33.7 KB)


Thanks dear Quan Li