You will write the walk of the lesson as code, for the equation .
The idea. At a point the equation gives the slope . A step of width along that slope changes the height by . Many short steps trace a curve.
Your tasks.
slope_at(x, y). Return the slope that the equation gives at the point.step(x, y, h). Return the new height after one step of width h.walk(x0, y0, h, n). Start at (x0, y0), take n steps, and return the final height.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…