kangwonlee/nmisp

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

Open

#397 opened on Apr 30, 2026

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Jupyter Notebook (76 forks)auto 404
good first issuepedagogy

Repository metrics

Stars
 (12 stars)
PR merge metrics
 (PR metrics pending)

Description

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.

Contributor guide