I would not call this a that simple but here is now you can do it:
Let's first have some notations (given the picture you provided):
A = green dot; B = pink; C = Purple; D = Red
Q = blue;
P = the polygon defined by a set of segments or lines.
So basically you want to know if any line
QC , or
QD intersects your polygon
The naive way to do this is to define the polygon with a a set of segments you can use line-line intersection to test this:
bool intersect(Polygon P, Line l)
for_each(Line pl in P.segments)
if(intersects(pl,l)) //line-line intersection
return true;//line intersects polygon
if(intersect(P,QA)) -> point A is in front of the polygon relative to Q
To simplify the problem i think you want to check if any point
C is visible from the players's perspective
D and in this case you don't have to take a reference point
Q you can just do
intersect(P,AD), 'BD' and
You would basically have to do this for each polygon in your scene which is not that efficient in the end (if you have a big scene). The best approach is to use spacial partitioning like a BSP tree (best for your case) but this is not that trivial to implement.
If you scene is small or relatively small you can use the approach described above and you can even improve this by adding a 2d Grid to store references to polygons that you want to test.