Skip to content

Pedagogy: complete 00_introduction/40_how_to_draw_a_circle.ipynb (hint, solution, exercises) #397

@kwlee2025cpp

Description

@kwlee2025cpp

Goal

00_introduction/40_how_to_draw_a_circle.ipynb is one of the strongest pedagogical notebooks in the chapter — same object expressed three ways (closed form, implicit, parametric). Cell 26 sets up an exercise ("Fix the figure above") referring to a parametric plot whose np.cos(theta_deg) is wrong because cos expects radians. But the notebook never gives a hint or solution, so the exercise is open-ended and silent.

Scope — 5 small edits

  1. Hint cell before cell 23: "What units does np.cos() expect? Try np.cos(np.pi) vs np.cos(180)."
  2. Solution cell after cell 26: shows theta_rad = np.deg2rad(theta_deg) and re-plots the corrected circle.
  3. Cell 23 np.linspace(0, 360)np.linspace(0, 360, num=?): surface the num parameter so cell 27's "how many calculations?" question has a knob to vary.
  4. Two follow-up exercises:
    • Draw an ellipse (a ≠ b), parametric form.
    • Draw a Lissajous figure: x = cos(aθ), y = sin(bθ), try a/b = 2/3.
  5. (Optional) Cell 19: one-line markdown explaining why Z = -np.abs(...) makes the contour minimum trace the circle.

Why

  • Closes a teaching loop the notebook already opened.
  • Cheapest pedagogical win in the entire intro chapter (~6 cells added).
  • Will eventually move to 06_python_advanced/80_circle_case_study.ipynb per the restructure — content fixes go in first so the move is mechanical.

Acceptance

  • All 5 edits applied (item 5 optional).
  • Notebook executes top-to-bottom.
  • Solution cell shows the corrected output (visible circle, not garbage).
  • Exercises have solution cells too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomerspedagogyNotebook content / teaching changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions