Created
July 3, 2019 16:11
-
-
Save anotherjesse/a17f50dc4cc27e892ba601649692805c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 width, height, center; | |
| var points = 10; | |
| var smooth = true; | |
| initializePath(500, 100, 200); | |
| function initializePath(num_rays, radius, length) { | |
| center = view.center; | |
| width = view.size.width; | |
| height = view.size.height/2; | |
| for (var i=0; i<num_rays; i++) { | |
| var theta = (i/num_rays)*3.14*2; | |
| console.log(theta) | |
| var path = new Path(); | |
| path.strokeColor = 'black'; | |
| path.add(new Point(center.x + radius*Math.sin(theta), | |
| center.y + radius*Math.cos(theta))); | |
| var outerRadius = radius+length*(Math.random()+1.0) | |
| path.add(new Point(center.x + outerRadius*Math.sin(theta), | |
| center.y + outerRadius*Math.cos(theta))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment