title: How to know IF a line segment intersects a triangle in 3d space?
body: <p>I have a triangle defined by 3 points in 3d space. I also have a line segment defined by 2 points in 3d space. I want to know if they intersect. I don't really need to know the point of intersection.</p>
  
  <p>I don't know any calculus but I know some trig. I know some about matrices but I understand vectors well (3d vectors specifically). Please keep it simple.</p>
  
  <p>Can you walk me through the example problem:</p>
  
  <p>triangle:</p>
  
  <p>a: -4, 3, 0</p>
  
  <p>b: 4, 3, 0</p>
  
  <p>c: -3, -5, 4</p>
  
  <p>line segment:</p>
  
  <p>d: 1, -2, 0</p>
  
  <p>e: -2, 6, 2</p>
  
  <p>EDIT:</p>
  
  <p>I am going to use this in a c++ physics engine.</p>
  
  <p>One answer involved tetrahedron volume calculation from 4 vertices. Please provide formula or show it in code.</p>
  
  <p>UPDATE:</p>
  
  <p>As meowgoesthedog pointed out, I could try to use the <a href="https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm" rel="nofollow noreferrer">Moller-Trumbore</a> intersection algorithm. See my answer below for an alternate solution.</p>