File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ This enables the use of arithmetic operations when quantities have compatible un
104104
105105``` python
106106distance_start = 10 * u.mm
107- distance_end = 23 * u.km
107+ distance_end = 20 * u.km
108108length = distance_end - distance_start
109109print (length)
110110```
@@ -349,6 +349,8 @@ angle in degrees: 90.0; and in radians: 1.5707963267948966
349349Now 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+
352354print (f ' sin of 90 degrees is: { np.sin(angle)} ' )
353355print (f ' sin of pi/2 radians is: { np.sin(1.57079632 )} ' )
354356print (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+
379383plt.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'}
You can’t perform that action at this time.
0 commit comments