title: How do I check if a line is behind a vertex?
body: <p>I have an algorithm where I trace convex polygons from a light source, all contained between 4 walls.This is the algorithm:</p>
  
  <p>Preparation - add all vertices to an array, sorted by their angle from the light source and then add all lines made by all vertices in another array.</p>
  
  <p>Loop all vertices and rotate the ray to their angles
    Set each vertex to be the nearest point.
    For each vertex loop all lines and intersect the ray with them, if a line/ray intersection point is closer than the previous nearest point then set this as the nearest point.</p>
  
  <p>This works perfectly except for this case:
  <img src="https://i.stack.imgur.com/vUx94.png" alt="enter image description here">
  The green lines aren't being considered by the algorithm.How can I make it continue beyond the ends of the polygon?</p>