Confusion related to this algorithm about finding the orientation given 3 points
The orientation of three points in the plane is classically done with a determinant. In the linked article the approach is done on a polygon thus they use a 3x3 determinant. For only three points, i.e., a triangle, a 2x2 determinat is sufficient. 

Let $p_1=(x_1,y_1), p_2=(x_2,y_2)$, and $p_3=(x_3,y_3)$ be three points in the plane. Then we compute the orientation vectors at $p_1$, that is $p_{1,2}=p_2-p_1$ and $p_{1,3}=p_3-p_1$. Now we use the determinant to find the orientation: $$\mathrm{det}\begin{bmatrix}x_2-x_1&amp;y_2-y_1\\x_3-x_1&amp;y_3-y_1\end{bmatrix}=(x_2-x_1)(y_3-y_1)-(y_2-y_1)(x_3-x_1).$$ 

If the result is smaller than zero then $(p_1,p_2,p_3)$ are in counter-clockwise order, if larger than zero in clockwise order, and if zero then they are collinear.