Trigonometry solution