From 2688e288bc548de64561c2489717bdc21ff18baf Mon Sep 17 00:00:00 2001 From: scottan <33283688+Scottan@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:39:55 +0100 Subject: [PATCH 1/3] Update 05-units_and_quantities.md --- episodes/05-units_and_quantities.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/episodes/05-units_and_quantities.md b/episodes/05-units_and_quantities.md index 06e7f0a..25defb7 100644 --- a/episodes/05-units_and_quantities.md +++ b/episodes/05-units_and_quantities.md @@ -104,7 +104,7 @@ This enables the use of arithmetic operations when quantities have compatible un ```python distance_start = 10 * u.mm -distance_end = 23 * u.km +distance_end = 20 * u.km length = distance_end - distance_start print(length) ``` From 6fd7790ab5ed65d83c756572ea432f39cb8f05d3 Mon Sep 17 00:00:00 2001 From: scottan <33283688+Scottan@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:40:48 +0100 Subject: [PATCH 2/3] add numpy import before use of np.sin() --- episodes/05-units_and_quantities.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/episodes/05-units_and_quantities.md b/episodes/05-units_and_quantities.md index 25defb7..71a0f61 100644 --- a/episodes/05-units_and_quantities.md +++ b/episodes/05-units_and_quantities.md @@ -349,6 +349,8 @@ angle in degrees: 90.0; and in radians: 1.5707963267948966 Now we can pass the angle directly to `np.sin` without having to convert directly to radians: ```python +import numpy as np + print(f'sin of 90 degrees is: {np.sin(angle)}') print(f'sin of pi/2 radians is: {np.sin(1.57079632)}') print(f'sin of 90 degrees is not: {np.sin(90)}') From b17e59e5a4f6cc2c464c449bf4b3b58f04938836 Mon Sep 17 00:00:00 2001 From: scottan <33283688+Scottan@users.noreply.github.com> Date: Wed, 29 Apr 2026 20:45:03 +0100 Subject: [PATCH 3/3] Update 05-units_and_quantities.md Included import for matplotlib --- episodes/05-units_and_quantities.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/episodes/05-units_and_quantities.md b/episodes/05-units_and_quantities.md index 71a0f61..fb539a9 100644 --- a/episodes/05-units_and_quantities.md +++ b/episodes/05-units_and_quantities.md @@ -378,7 +378,10 @@ angles = np.arange(181) * u.deg ``` ```python +import matplotlib.pyplot as plt + plt.plot(angles, np.sin(angles)) +plt.show() ``` ![](fig/sin_curve_deg.png){alt='Plot of sin curve for degrees between 0-180'}