Skip to content

Instantly share code, notes, and snippets.

@molnarg
Created April 23, 2013 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save molnarg/5442948 to your computer and use it in GitHub Desktop.
Save molnarg/5442948 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="rajz" width="700" height="700"></canvas>
<script>
var rajz = document.getElementById('rajz');
var context = rajz.getContext('2d');
var circle = function(r) {
context.beginPath();
context.arc(0, 0, r, 0, Math.PI*2, true);
context.fill();
};
context.fillStyle = 'black';
context.translate(300, 300);
var magic = (Math.sqrt(5) - 1) * Math.PI;
for (var j = 0; j < 500; j++) {
context.rotate(magic);
context.translate(0, j/2);
circle(1 + j / 45);
context.translate(0, -j/2);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment