title: calculate direction of 3d triangle in stl file
body: <p>I have this triangle:</p>
  
  <p><a href="https://i.stack.imgur.com/HL4A6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HL4A6.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/XiL7k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XiL7k.png" alt="enter image description here"></a></p>
  
  <p>In this stl file:</p>
  
  <pre><code>solid
    facet normal -3.42 2.42 2.72
      outer loop
        vertex 0.75 0.06 0.15
        vertex 3.86 0.06 4.06
        vertex 1.75 0.93 0.63
      endloop
    endfacet
  endsolid
  </code></pre>
  
  <p>And I need to figure out a way to get the triangle face direction/angle based on its centroid vertex (orange vector). I do have the values of the centroid but I can't think of a way to get the value of the direction of the triangle. Whenever the triangle is rotated its face/direction should return x,y,z value representing that movement. Any help or hints would be much appreciated. Solution can be written in any language or even pseudo code.</p>