Skip to content

Instantly share code, notes, and snippets.

@runemadsen
Forked from reginavetka/something
Created October 6, 2016 17:12
Show Gist options
  • Save runemadsen/7e25827cdc6321f45372f210dd19c79c to your computer and use it in GitHub Desktop.
Save runemadsen/7e25827cdc6321f45372f210dd19c79c to your computer and use it in GitHub Desktop.
var r = new Rune({
container: "#canvas",
width: 800,
height: 600
});
var rad;
var offset;
var angle;
var k;
r.rect(0, 0, r.width, r.height).fill(0);
rad = 100;
offset = r.height /2;
angle = 0;
var myShape = r.polygon(0, 0)
.fill(false)
.stroke(255)
while(angle < 100) {
angle += 0.09;
rad += 0.05;
k = 4/5;
var x = Math.cos(k * angle) * Math.cos(angle) * rad;
var y = Math.cos(k * angle) * Math.sin(angle) * rad;
myShape.lineTo(x + r.width / 2, y + r.height / 2, 10, 10)
}
r.draw();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment