Official

C - Convex Quadrilateral Editorial by en_translator


In fact, the following property holds:
For two different points \(A=(A_x,A_y),B=(B_x,B_y)\), the angle \(\angle AOB\) is strictly less than \(180\) degrees if \(A_xB_y-A_yB_x>0\); the angle is greater than or equal to \(180\) degrees if \(\leq 0\). Here, the angle is measured counterclockwise.

To prove this, it is common to use the cross product.

About the cross product Definition of cross product:
The cross product $a\times b$ of two vectors $a$ and $b$ in a three-dimensional space is a vector perpendicular to both $a$ and $b$ in the direction determined by the right-hand rule (see the figure) with the length equal to the area of parallelogram spanned by the two vectors.

(The figure quoted from Wikipedia)
Property of cross product:
Let $a=(a_1,a_2,a_3)$ and $b=(b_1,b_2,b_3)$, then $a\times b=(a_2b_3-a_3b_2,a_3b_1-a_1b_3,a_1b_2-a_2b_1)$.
The claim in the beginning is obtained by the property of cross product, considering two points $(A_x,A_y,0)$ and $(B_x,B_y,0)$.

Due to this fact, we can determine if the angle \(B\) is less than \(180\) degrees using \(C-B\) and \(A-B\) as follows:

Alternatively, we can determine using \(B-A\) and \(C-B\):

posted:
last update: