Solving triangles using trigonometric functions