fourier-transform-drawing
fourier-transform-drawing copied to clipboard
Inspired by 3Blue1Brown. Apply fourier transform to an SVG path and draw the result on canvas.
fourier-transform-drawing
Inspired by 3Blue1Brown - Pure Fourier series animations for 12 oddly satisfying minutes
Example svg from Wikimedia
You may view the result at https://skyzh.github.io/fourier-transform-drawing/
What does it do
Let f : R -> R^2, f denotes a function from time t to complex plane.
f represents a svg path. Obtain fourier series of f.
On the webpage a blue circle represents one term in the series.
Generation Steps
- Install Python, Node.js, etc. Run
yarn startto start dev server. Replace SVG path inindex.html. Visit web page athttp://localhost:8080 - Edit
transform_pointfunction, watch pattern inOriginal SVG, adjust until the pattern fills the canvas. - Click Dump SVG Data. Note that it may take a long time. View progress in console. Copy
fft_data.jsonto analysis folder. - Adjust
freq_rangein analysis.py. Run./analysis.py > dump.json. - Run
yarn startagain to see the result. You may see pattern like this
