A little ipy example¶
Here we shall execute a small example
import sys,os
sys.path.insert(0,os.path.abspath("../../"))
from sphinx_example.a_module import a_math_func
We’ll use this function to do the simple integer right triangle:
a_math_func(3,4)
Result is: 5.0
5.0
Another section¶
This section does things another way...
a_math_func(5,4,hypot=False)
Result is: 3.0
3.0
Another subsection¶
In which we make a plot
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
a = np.linspace(1,10,50)
b = 1.0
_ = plt.plot(a,a_math_func(a,b))
Result is: [ 1.41421356 1.5495428 1.69400049 1.8454442 2.0022894
2.16336157 2.32778341 2.49489274 2.66418391 2.8352661
3.00783373 3.18164509 3.35650698 3.53226339 3.70878714
3.88597367 4.06373628 4.24200254 4.42071154 4.59981167
4.77925895 4.9590157 5.13904945 5.31933207 5.49983908
5.6805491 5.86144335 6.04250528 6.22372026 6.4050753
6.58655883 6.76816051 6.94987108 7.13168222 7.31358643
7.49557693 7.67764758 7.85979282 8.04200758 8.22428723
8.40662756 8.5890247 8.7714751 8.95397552 9.13652295
9.31911463 9.50174801 9.68442074 9.86713061 10.04987562]