 <p>Yes, you may use inner_product (dot product) to take the result in very simple way.</p> <p>Make vectors </p> <pre><code>V2 = P - P2 V3 = P - P3 V = P3 - P2 </code></pre> <p>Find signs of dot products <code>D2 = Dot(V2,V)</code> and <code>D3 = Dot(V3,V)</code></p> <p>Projection of Point P lies at S(P2, P3), if </p> <pre><code>D2 &gt;=0 and D3 &lt;=0 </code></pre> <p>Note - there is no need in normalizations, square roots etc. Just some subtractions, multiplications and additions.</p> <p>(Explanation - angles <code>P-P2-P3</code> and <code>P-P3-P2</code> should be acute or right)</p>