title: Convex hull algorithm to determine points inside of the triangle
body: <p>I have a bichromatic set <code>S</code> with red and green points in plane general position (no three points of S are collinear). The red triangle is made such that all of its three vertices are red points of S. Green point <code>p</code> of <code>S</code> is said to be enclosed by a red triangle If <code>p</code> lies in the interior of that triangle.</p>
  
  <p>I am supposed to make an algorithm that finds all the green points inside the triangles.
  <img src="https://i.imgur.com/ITBoUrY.png" alt="example" title="example">
  I tried to make my own algorithm after seeing a bit from online resources such as:
  <a href="http://totologic.blogspot.com/2014/01/accurate-point-in-triangle-test.html" rel="nofollow noreferrer">http://totologic.blogspot.com/2014/01/accurate-point-in-triangle-test.html</a></p>
  
  <p>And here is my "solution":</p>
  
  <pre><code>green_inside = all_the_greens
  for each triangle T in get_all_triangles()
    for each greenie G in green_inside
      if G in T
        remove G from green_inside
  
  greenies_in_triangles = all_the_greens - green_inside
  </code></pre>
  
  <p>I do not know whether this algorithm works.
  And its runtime is <code>n^3</code>. Also, I am not sure If I can just say <code>get_all_triangles</code>.
  This algorithm that I am supposed to create should be the most efficient one I can come up with, so please any other solutions or suggestions are welcome!</p>