Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Bhavna sets x = np.linspace(0, 360, 721) and plots np.sin(x), meaning to draw one turn in degrees. Her plot is a crowd of tiny waves. How many points does x have? How many degrees apart are they? How many cycles does she really draw, since np.sin reads each number as radians?
has amplitude , period and phase shift to the right. repeats every and has asymptotes where . np.linspace(a, b, n) makes numbers with both ends included. Angles in degrees must be converted with np.radians before np.sin.
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. Points. np.linspace(0, 360, 721) makes numbers.
Step 2. Step. degrees apart.
Step 3. Cycles. np.sin reads as radians, and cycles fit into it.
Answer: points, apart, and cycles. The fix is np.sin(np.radians(x)).
Log in to join the discussion.
Loading…