Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- from fractions import Fraction
- W = [Fraction(1)]
- def tracer(f, pts): plt.plot(pts, [f(x) for x in pts])
- def W2p1(n):
- if n>=len(W):
- W.append(Fraction(2*n, 2*n+1)*W2p1(n-1))
- return W[n]
- def phi(n): return lambda x: (1-x**2)**n/2/W2p1(n).real
- def subdiv(n): return [-1+i*(2)/n for i in range(n)]
- ##
- pts = subdiv(1000)
- ##
- for n in range(500):
- tracer(phi(n), pts)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement