Solver for triangle sides and angles in Java