Skip to content

Instantly share code, notes, and snippets.

@robinhouston
robinhouston / README.md
Last active October 27, 2019 19:14
Slider – Talkie demo

A demonstration of the slider module.

@robinhouston
robinhouston / README.md
Last active December 14, 2015 02:59
Multiple sliders – Talkie demo

Several sliders at once.

@robinhouston
robinhouston / index.html
Last active October 27, 2019 19:15
Dudeney’s hinged triangle-square
<!DOCTYPE html>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
div { width: 800px; height: 500px; margin: auto; }
svg { width: 100%; height: 100%; stroke-width: 0.01; stroke: white; fill: #4485B6; }
</style>
<div></div>
<script>
function point_to_string(point, origin) {
if (typeof origin == "undefined") origin = [0, 0];
@robinhouston
robinhouston / index.html
Last active December 19, 2015 21:58
Maze flood fill
<!DOCTYPE html>
<title>Maze flood fill</title>
<style>
canvas { display: block; margin: auto; border: 1px solid #999; }
</style>
<canvas width="800" height="500"></canvas>
<script>
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
@robinhouston
robinhouston / 800x500.png
Last active October 27, 2019 19:15
Algorithmic painting
800x500.png
@robinhouston
robinhouston / doyle.js
Last active December 27, 2023 01:09
Doyle spiral circle packing
/* Numerics for Doyle spirals.
* Robin Houston, 2013
*/
(function() {
var pow = Math.pow,
sin = Math.sin,
cos = Math.cos,
pi = Math.PI;
@robinhouston
robinhouston / doyle.js
Last active December 23, 2015 09:16
Doyle spiral explorer
/* Numerics for Doyle spirals.
* Robin Houston, 2013
*/
(function() {
var pow = Math.pow,
sin = Math.sin,
cos = Math.cos,
pi = Math.PI;
@robinhouston
robinhouston / index.html
Created July 28, 2013 11:52
Double Doyle spiral via Möbius transformation
<!DOCTYPE html>
<meta charset="utf-8">
<title>Doyle spiral + Möbius transformation = &#x1F632;</title>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script>
<canvas width=960 height=500></canvas>
<script>
// Initialisation
var canvas = document.getElementsByTagName("canvas")[0],
context = canvas.getContext("2d");
@robinhouston
robinhouston / index.html
Created July 28, 2013 13:02
Spiral triangles
<!DOCTYPE html>
<title>Triangular spiral</title>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script>
<canvas width=960 height=500></canvas>
<script>
// Initialisation
var canvas = document.getElementsByTagName("canvas")[0],
context = canvas.getContext("2d");
@robinhouston
robinhouston / index.html
Created July 28, 2013 13:24
Stumbling blocks
<!DOCTYPE html>
<title>Stumbling blocks</title>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/rAF.js" charset="utf-8"></script>
<script src="http://bl.ocks.org/robinhouston/raw/6096562/doyle.js" charset="utf-8"></script>
<canvas width=960 height=500></canvas>
<script>
// Initialisation
var canvas = document.getElementsByTagName("canvas")[0],
context = canvas.getContext("2d");