Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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
You can’t perform that action at this time.