You will write three small functions about inverse functions: the mirror image of a point, an inverse sine found by halving an interval, and the inverse cotangent. The checker tests them on many values.
The idea. A point of a function becomes on its inverse. On the sine branch the sine rises, so you can find the angle with a given sine by halving an interval again and again. The inverse cotangent with range is .
Your tasks.
mirror(point). It returns the point with its two numbers swapped.arcsin_by_search(v). Start with low = -pi / 2 and high = pi / 2. Halve the interval times, keeping the half where the sine of the angle can equal v.arccot(x). Return the principal value of the inverse cotangent, an angle in .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…
With Standard, you also open 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.