 Therefore,

which is the law of cosines.Using algebraic measures for line segments (allowing negative numbers as lengths of segments) the case of obtuse angle () and acute angle () can be treated simultaneously.By using the law of sines and knowing that the angles of a triangle must sum to 180 degrees, we have the following system of equations (the three unknowns are the angles)