Weierstrass

There’s something wonderfully unsettling about a function that has no tangent anywhere, no matter how far you zoom in.

#!/usr/bin/env python3
import numpy as n,matplotlib.pyplot as p
a=.5;b=11;n_terms=50
x=n.linspace(-2,2,20000)
f=sum(a**k*n.cos(b**k*n.pi*x) for k in range(n_terms))
p.plot(x,f,'b',lw=.1)
p.title('Weierstrass Function')
p.grid()
p.show()

Unknown's avatar

About Linuxgal

Need a spiritual home? Consider joining us at Mary Queen of the Universe Latter-day Buddhislamic Free Will Christian UFO Synagogue of Vishnu
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply