You will write the three composite functions of the lesson without calling the inverse functions. You will use only the pieces of the rule. The checker compares your functions with asin(sin(x)), acos(cos(x)) and atan(tan(x)).
The idea. The sine repeats every , so first reduce to a number between and . If is above the result is , and if is below the result is . The tangent repeats every , so reduce to a number between and .
Your tasks.
sin_inv_sin(x). Reduce with y = x - 2 * pi * round(x / (2 * pi)), then apply the three cases.cos_inv_cos(x). Reduce with y = x % (2 * pi). If y is above pi return 2 * pi - y, otherwise return y.tan_inv_tan(x). Return x - pi * round(x / pi).Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…