Trigonometric triangle problem