Skip to content

Commit 76add33

Browse files
committed
markdown source builds
Auto-generated via `{sandpaper}` Source : 694ee06 Branch : main Author : scottan <33283688+Scottan@users.noreply.github.com> Time : 2026-05-06 10:46:55 +0000 Message : Merge pull request #111 from UoMResearchIT/109-correct-calculation-in-units-and-quantities 109 correct calculation in units and quantities
1 parent 86fefa9 commit 76add33

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

05-units_and_quantities.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ This enables the use of arithmetic operations when quantities have compatible un
104104

105105
```python
106106
distance_start = 10 * u.mm
107-
distance_end = 23 * u.km
107+
distance_end = 20 * u.km
108108
length = distance_end - distance_start
109109
print(length)
110110
```
@@ -349,6 +349,8 @@ angle in degrees: 90.0; and in radians: 1.5707963267948966
349349
Now we can pass the angle directly to `np.sin` without having to convert directly to radians:
350350

351351
```python
352+
import numpy as np
353+
352354
print(f'sin of 90 degrees is: {np.sin(angle)}')
353355
print(f'sin of pi/2 radians is: {np.sin(1.57079632)}')
354356
print(f'sin of 90 degrees is not: {np.sin(90)}')
@@ -376,7 +378,10 @@ angles = np.arange(181) * u.deg
376378
```
377379

378380
```python
381+
import matplotlib.pyplot as plt
382+
379383
plt.plot(angles, np.sin(angles))
384+
plt.show()
380385
```
381386

382387
![](fig/sin_curve_deg.png){alt='Plot of sin curve for degrees between 0-180'}

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"episodes/02-dictionaries.md" "01d0b5ca498525f3fff069efae731735" "site/built/02-dictionaries.md" "2026-04-21"
99
"episodes/03-numpy_essential.md" "b1bc2d8b36e7bf87aa19a15ef7b398da" "site/built/03-numpy_essential.md" "2026-04-22"
1010
"episodes/04-defensive_programming.md" "ce45abd6568655cc3d9ad19c15be27db" "site/built/04-defensive_programming.md" "2026-05-06"
11-
"episodes/05-units_and_quantities.md" "80b2c978e8e059a4e0fabf00c741db5b" "site/built/05-units_and_quantities.md" "2026-04-23"
11+
"episodes/05-units_and_quantities.md" "c0d3d1c4f55ef0aef9985294f465468b" "site/built/05-units_and_quantities.md" "2026-05-06"
1212
"episodes/06-pandas_essential.md" "b1059ad5fe7b7c4fcaf16c49e8e44bc5" "site/built/06-pandas_essential.md" "2026-04-23"
1313
"episodes/07-software_package_management.md" "bad70f7e80ca5eef51b9303b81e5d717" "site/built/07-software_package_management.md" "2026-04-24"
1414
"instructors/instructor-notes.md" "a59fd3b94c07c3fe3218c054a0f03277" "site/built/instructor-notes.md" "2025-04-15"

0 commit comments

Comments
 (0)