Skip to content

Instantly share code, notes, and snippets.

@omidmnz
omidmnz / noderiv.py
Created December 15, 2017 21:00
Plotting a Nowhere-Differentiable Function
import numpy as np
import matplotlib.pyplot as plt
def f(x):
"""The original wave!"""
return -2 * (np.abs((x % 1) - 1 / 2)) + 1
def construct(steps=20, threshold=10e-5):