Skip to content

Instantly share code, notes, and snippets.

View jbrd's full-sized avatar

James Bird jbrd

View GitHub Profile
@jbrd
jbrd / butterfly-diagram.js
Last active January 21, 2020 20:11
Render an interactive Radix-2 butterfly diagram using d3.js 4
// Draw a butterfly diagram of the given size in the given svg element.
//
// Example usage:
//
// var svg = d3.select("body").append("svg").attr("width", 500).attr("height", 500);
// draw_butterfly_graph(svg, 3);
//
// Requires d3.js 4.
//
function draw_butterfly_graph(svg, logn) {
@jbrd
jbrd / aperiodic-improved-perlin-noise.cpp
Created January 27, 2017 20:27
Aperiodic Improved Perlin Noise Example
//
// Aperiodic Improved Perlin Noise
// James Bird (jbrd.github.io)
//
// A version of Ken Perlin's Improved Perlin Noise, rewritten in C++ and
// expanded to use a higher precision (but more expensive) initial hashing
// function to overcome the 256-unit repetition in the reference code.
//
// Adapted from Ken Perlin's Improved Perlin Noise Code:
// http://mrl.nyu.edu/~perlin/noise/