Created
August 19, 2016 16:33
-
-
Save paulocanedo/cf62cf8a9a10c6af0f56a8bddc6516ea to your computer and use it in GitHub Desktop.
construir estrela
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
| buildStar(x, y, radius) { | |
| let pentagon = this.buildPolygonRegular(x, y, radius, 5); | |
| let p0 = lineIntersection(pentagon[0], pentagon[2], pentagon[1], pentagon[4]); | |
| let p1 = lineIntersection(pentagon[0], pentagon[2], pentagon[1], pentagon[3]); | |
| let p2 = lineIntersection(pentagon[2], pentagon[4], pentagon[3], pentagon[1]); | |
| let p3 = lineIntersection(pentagon[2], pentagon[4], pentagon[3], pentagon[0]); | |
| let p4 = lineIntersection(pentagon[0], pentagon[3], pentagon[1], pentagon[4]); | |
| let output = []; | |
| output.push( | |
| pentagon[0], s0, s4, | |
| pentagon[1], s0, s1, | |
| pentagon[2], s1, s2, | |
| pentagon[3], s2, s3, | |
| pentagon[4], s3, s4 | |
| ); | |
| return output; | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment