title: Calculate if a line intersects a face
body: <p>I'm writing an 3D application. I have to deteminate at which face the user is currently looking (not always axis aligned).</p>
  
  <p>I have the position of each face as four points.
  I have the line as a vector.</p>
  
  <p>I've looked up that i can calculate the normal of the face and with that the equation(s) of the face. I can also calculate the equation of the line.</p>
  
  <p>If i merge those i am able to calculate the intersection point (on the plane) and then look if that point is on the face. But how do i solve those equations in code?</p>
  
  <p>How can i simply calculate if the line intersects with the face?</p>
  
  <p>Edit:
  How can i solve these equations using java code?</p>
  
  <pre><code> Equations of Line
   x = point.x - dir.x * t
   y = point.y - dir.y * t
   z = point.z - dir.z * t
  
   Equation of Plane
   normal.x * (x - face[0].x) + normal.y * (y - face[0].y) + normal.z * (z - face[0].z) = 0
  </code></pre>