Triangle Inequality and Angle Sum: Solving and Detecting Impossible Triangles