I came up with the following algorithm to find weather a given triangle contains origin or not. Applying on $1000$ test cases, I got $232$ while the correct answer is $228$. Please verify if the algorithm is mathematically valid or not.
$1$)Name the vertices $A,B,C$
$2$)Find Angle of line from origin to the point with positive $x$-Axis. Name them $\angle a,\angle b, \angle c$. This is done via $\arctan(\left|{y\over x}\right|)$.
If First quadrent, no change required.
If second quadrent, $180-\arctan(\left|{y\over x}\right|)$.
If third quadrent $270-\arctan(\left|{y\over x}\right|)$.
If fourth, then $360-\arctan(\left|{y\over x}\right|)$
$3$)Find Angle between the lines $OA,OB,OC$.
which would be min$\left(|\angle a-\angle b|,360-|\angle a-\angle b|\right)$ for $OA$ and $OB$ and so on.
$4$) If the sum of these differences is $360$, then the triangle contains origin.
The test cases do NOT contain any point on origin or the $x$ or $y$ axis.


you might like to try an alternative method that may be more transparent and robust.
supposing Q lies within ABC. a test probe P moving from A towards B should initially observe a decrease in the distance $PQ = r_{\lambda}$. if we parameterize the position of the probe as $$ P_{\lambda} = \lambda A + (1-\lambda) B $$
then for an internal point $Q$ we should have:
$$ \frac{d|P_\lambda Q|^2}{d\lambda}\bigg|_{\lambda= 0} \lt 0 $$
if $A = (x_1,y_1), B= (x_2, y_2), C=(x_3,y_3)$, and $Q=(x_0, y_0)$ then this test computes as:
$$ (a_2-a_1)(a_1-a_0) +(b_2-b_1)(b_1-b_0) \lt 0 $$
with similar tests for the other two sides, BC and CA, obtained by cyclic permutation.