Solving Equations for Trigonometric Functions