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 rules = { | |
| X: "X+YF+", | |
| Y: "-FX-Y" | |
| }; | |
| function rewrite(str) { | |
| var s = ""; | |
| for (var i = 0; i < str.length; i++) { | |
| if (rules[str[i]] !== undefined) { | |
| s += rules[str[i]]; |
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
| // this is a slow convex hull calculation that you can count on to work | |
| // it's careful of the epsilon cases, and wether or not | |
| // to include collinear points along the hull edge | |
| var EPSILON_LOW = 0.003; | |
| var EPSILON = 0.00001; | |
| var EPSILON_HIGH = 0.00000001; | |
| function epsilonEqual(a, b, epsilon){ | |
| if(epsilon === undefined){ epsilon = EPSILON_HIGH; } |
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
| #include "ofApp.h" | |
| //-------------------------------------------------------------- | |
| void ofApp::setup(){ | |
| ofSetVerticalSync(true); | |
| soundStreamInput.printDeviceList(); | |
| bufferSize = 256; |
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
| // http://ssd.jpl.nasa.gov/txt/aprx_pos_planets.pdf | |
| typedef enum{ | |
| Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto | |
| } Planet; | |
| // a e I L long.peri. long.node. | |
| // AU rad deg deg deg deg | |
| static double elements[] = {0.38709927, 0.20563593, 7.00497902, 252.25032350, 77.45779628, 48.33076593, //mercury | |
| 0.72333566, 0.00677672, 3.39467605, 181.97909950, 131.60246718, 76.67984255, //venus | |
| 1.00000261, 0.01671123, -0.00001531, 100.46457166, 102.93768193, 0.0, //earth moon barycenter |
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
| // the 5 platonic solids | |
| // | |
| // + point coordinates | |
| // + the related drawing functions | |
| // + a rotate in 3D function, around the origin | |
| // | |
| // written for Processing (processing.org) | |
| int xCenter = // center of polyhedra | |
| int yCenter = // center of polyhedra |
NewerOlder