diff --git a/episodes/05-units_and_quantities.md b/episodes/05-units_and_quantities.md index 06e7f0a..fb539a9 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) ``` @@ -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)}') @@ -376,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'}