It is given that the intensity of certain point is given by
As the fence has height
The problem is not difficult to solve but, you need to deal with calculus.
Imagine a lamp point
Case I:
Let the point to segment distance be
By trigonometry,
By Pythagors' Theorem,
Therefore,
By integration,
Note that
.
Therefore the total intensity of
You may see that the result is simply dealing with the included angle between the light source and the fence segment.
Case 2:
By case 1, the result still holds (Just complement angle only).
Since the inclination of the fence to the lamp does not matter, the final conclusion is that: from the point of view of the lamp, how much angle the polygon is inclined to it, the result is simply by using the above equation.
Be careful:
- Use acos(-1) instead of pasting constant from wiki as
- Determine if a point is inside a general polygon
- Even though the point is outside the polygon, the view angle can still be