The problem is not the sign but the value. I use absolute value of the angle (no matter what method i used to calculate it).

$\displaystyle abs(arctan(m_2) -actan(m_1)) = abs(arctan(m_1) -actan(m_2))$

That's eliminates some tests ^^...

So... (this image should help)

We have 2 segment that have in common $\displaystyle O(x,y)$

The first segment ends in $\displaystyle P_4(x_4,y_4)$

If the other segment ends in $\displaystyle P_2(x_2,y_2)$ the angle is alpha

but if the other segment ends in $\displaystyle P_1(x_1,y_1)$ the angle is beta... now, how can I choose the calculation method?

EDIT:

I'm trying now Law of Cosines too... but maybe i'm too tired now :O

If someone is good at, here is my

source in python, i hope is enough readable.

The input consist in a set of 3 point $\displaystyle x_1,y_1,x_2,y_2,x_3,y_3$ and the output should be something like "isosceles right triangle" or "scalene obtuse triangle" or other classification or "not a triangle" if it is not...