2
If you get the cross product of the segments on both sides of the angles, and pick up your signal, you will have information of which direction the points are oriented, as shown in the code below.
// == 0: colineares; > 0: horario; < 0: anti-horario
int ordem(double ax, double ay, double bx, double by, double cx, double cy) {
double bax = ax - bx;
double bay = ay - by;
double bcx = cx - bx;
double bcy = cy - by;
return (bax * bcy - bay * bcx);
}
int main()
{
printf("P1, P2, P3 como em SOpt_125794: %d\n", ordem(5, 0, 0, 2, 5, 4));
printf("P3, P2, P1 como em SOpt_125794: %d\n", ordem(5, 4, 0, 2, 5, 0));
printf("Colineares em sequencia: %d\n", ordem(0, 0, 1, 1, 2, 2));
printf("Colineares com terceiro ponto no meio: %d\n", ordem(0, 0, 4, 4, 2, 2));
return 0;
}
Note that comparing exactly with zero can give you some false results because of the floating point approximation, so if you need greater precision, you can use something like (colineares se abs(order) < Epsilon), where Epsilon is a very small value.
And what have you done? Put a [mcve] and your specific question.
– Maniero