Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Maya prints the six ratios of the angles . Where a ratio is undefined, her program prints none. Run the program. What is , and how many none entries are in the whole table?
Degrees to radians: multiply by . Python's trigonometric functions take radians: math.sin(math.radians(d)). The point at angle on the unit circle is . Floats carry a rounding error of about , so compare them with math.isclose, not ==.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Step 1. The tangent. .
Step 2. The gaps. At the sine is , so the cosecant and the cotangent are undefined. At the cosine is , so the tangent and the secant are undefined.
Answer: , and there are none entries.
Log in to join the discussion.
Loading…