Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion episodes/05-units_and_quantities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
Expand Down Expand Up @@ -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)}')
Expand Down Expand Up @@ -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'}
Expand Down
Loading