Last active
June 25, 2018 16:20
-
-
Save jcalz/66d5c8720298c8f0af533cb6e8d23fae to your computer and use it in GitHub Desktop.
star clip-path
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
var format = x => ((x+.5)*100).toFixed(4)+'%'; | |
var f = ([[a,b],[c,d]]) => format(a)+' '+format(b)+', '+format(c)+' '+format(d); | |
var r = 1.5 - 0.5*Math.sqrt(5); | |
var th = Math.PI/2; | |
var pn = 2*Math.PI/5; | |
var R = .5; | |
var result=[0,1,2,3,4].map(k => | |
[[R*Math.cos(th+pn*(k-.5)),R*Math.sin(th+pn*(k-.5))],[r*R*Math.cos(th+pn*(k+0)),r*R*Math.sin(th+pn*(k+0))]]).map(f).join(', '); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment