The bisection method | View | Download | |
The Bessel function $J_2(x)$ | View | Download | |
Tour of matplotlib | View | Download | |
Parametric and implicit plots | View | Download | |
Prime numbers | View | Download | |
Statistics plots | View | Download | |
Stirling's approximation for $n!$ | View | Download |
plt.show()
to display the plot. You should not do this in the code that you enter in test system.)
plot_lissajous(n, m)
to plot the Lissajous curve $(x, y)=(\sin(n t),\cos(m t))$ for $0\leq t\leq 2\pi$.
figsize
option to make the plot have size $5\times 5$.aa4a44
)plt.show()
) in the online test on Moodle.
bisect(f, a, b)
which searches for a root of $f(x)$ in the interval $[a,b]$ (by a
rather mediocre method). It returns a list cs
of approximate roots.
Write a function show_bisect(f, a, b)
which calls bisect(f, a, b)
and then
generates a plot as follows:
bisect(f, a, b)
. I do not suggest that
you change the basic method, but various other things could be done better.
(None of this task is on the online test.)