solve a triangle for the case