Created
February 3, 2015 05:27
-
-
Save eldilibra/458d0df2ce788332c112 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 24; i > 0; i--) { | |
var fillColor = i % 2 == 0 ? 'blue' : 'orange'; | |
var largeArcFlag = i < 13 ? 0 : 1; | |
var angle = i * 15; | |
var x = Math.cos(toRadians(angle)) * 150 - 150; | |
var y = 0 - (Math.sin(toRadians(angle)) * 150); | |
var svgPath = '<path data-index="%s" d="M 200,200 l 150,0 a150,150 0 %s,0 %s,%s z" fill="%s" stroke="black" stroke-width="0.3" stroke-linejoin="round" />' | |
console.log(svgPath, i, largeArcFlag, x, y, fillColor); | |
} | |
function toRadians (angle) { | |
return angle * (Math.PI / 180); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment