Splitting a quadrilateral into two triangles if it has a vertex with an inner angle bigger than 180º I'm trying to write an app in which I need to test if a 3D quadrilateral has some angle equal or bigger to 180 degrees, Ie., it is a degenerated or concave quadrilateral. If this is true, I have to split it into two triangles.
I have no problem on dividing the quadrilateral in two but don't know how to solve the test condition.
Thanks in advance for your help.
Edit:
I only know the coordinates of the  vertices

Let's assume you have a quadrilateral in 3D, defined by four vertices
$$\begin{array}{l}
\vec{v}_1 = ( x_1 , y_1 , z_1 ) \\
\vec{v}_2 = ( x_2 , y_2 , z_2 ) \\
\vec{v}_3 = ( x_3 , y_3 , z_3 ) \\
\vec{v}_4 = ( x_4 , y_4 , z_4 ) \end{array}$$
If one of the vertices is not in the same plane as the other three, the quadrilateral is non-planar, or skew quadrilateral. There are typically more than one way to interpret the surface -- or rather, which vertex is the one that is non-planar with the other three, since any three (that are not collinear) can define a plane -- so we need further information than just the vertex coordinates to make the decision in such cases.
Because of this, I shall assume the quadrilateral is planar, and that the surface unit normal vector of the quadrilateral is $\hat{n}$.
If we compute four vector cross products between each pair of consecutive edge vectors,
$$\begin{array}{l}
\vec{c}_1 = \left ( \vec{v}_4 - \vec{v}_1 \right ) \times \left ( \vec{v}_2 - \vec{v}_1 \right ) \\
\vec{c}_2 = \left ( \vec{v}_1 - \vec{v}_2 \right ) \times \left ( \vec{v}_3 - \vec{v}_2 \right ) \\
\vec{c}_3 = \left ( \vec{v}_2 - \vec{v}_3 \right ) \times \left ( \vec{v}_4 - \vec{v}_3 \right ) \\
\vec{c}_4 = \left ( \vec{v}_3 - \vec{v}_4 \right ) \times \left ( \vec{v}_1 - \vec{v}_4 \right ) \end{array}$$
and the quadrilateral is convex, then all the cross product vectors are in the same half-space as the surface normal vector:
$$\begin{cases}
\vec{v}_1 \cdot \hat{n} \ge 0 \\
\vec{v}_2 \cdot \hat{n} \ge 0 \\
\vec{v}_3 \cdot \hat{n} \ge 0 \\
\vec{v}_4 \cdot \hat{n} \ge 0
\end{cases}$$
The equal case in the above occurs only when consecutive edge vectors are parallel, for example if $\vec{v}_3 = \lambda \vec{v}_2$, $\lambda \in \mathbb{R}$.
In fact, all of the cross products should be parallel to the surface unit normal, and you can even use the above to calculate the surface normal:
$$\hat{n} = \frac{\vec{v}_1}{\lVert\vec{v}_1\rVert} = \frac{\vec{v}_2}{\lVert\vec{v}_2\rVert} = \frac{\vec{v}_3}{\lVert\vec{v}_3\rVert} = \frac{\vec{v}_4}{\lVert\vec{v}_4\rVert}$$
In practice, you might wish to use the longest one for numerical stability.
If you find that, for example,
$$\vec{v}_2 \cdot \hat{n} \lt 0$$
it means the inner angle at vertex $\vec{v}_2$ is greater than 180°.
