フラクタル
/** * circular fractal * * @author aa_debdeb * @date 2016/04/08 */ void setup(){ size(640, 640); mousePressed(); } void draw(){ } void mousePressed(){ background(255); stroke(255); fill(0); for(int d = 2; d < 9; d++){ float size = width / …
/** * L-system (Plant3) * * @author aa_debdeb * @date 2016/02/20 */ LSystem lsystem; int step; void setup(){ size(500, 500); float d = 3.5; float delta = 20; String string = "X"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('X', "F[+X]F[-X]+X"</character,></character,>…
/** * L-system (Plant2) * * @author aa_debdeb * @date 2016/02/19 */ LSystem lsystem; int step; void setup(){ size(500, 500); float d = 8; float delta = 22.5; String string = "F"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('F', "FF-[-F+F+F]+[</character,></character,>…
/** * L-system (Plant) * * @author aa_debdeb * @date 2016/02/18 */ LSystem lsystem; int step; void setup(){ size(500, 500); float d = 4; float delta = 22.5; String string = "F"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('F', "F[+F]F[-F]F");</character,></character,>…
/** * L-system (Sierpinski gasket) * * @author aa_debdeb * @date 2016/02/17 */ LSystem lsystem; void setup(){ size(500, 500); float d = 1.5; float delta = 60; String string = "B"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('A', "B+A+B"); rul</character,></character,>…
/** * L-system (Dragon Curve) * * @author aa_debdeb * @date 2016/02/16 */ LSystem lsystem; void setup(){ size(500, 500); float d = 1; float delta = 90; String string = "FX"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('X', "X+YF"); rules.put(</character,></character,>…
/** * L-system (Koch Island) * * @author aa_debdeb * @date 2016/02/15 */ LSystem lsystem; void setup(){ size(500, 500); float d = 7; float delta = 90; String string = "F-F-F-F"; HashMap<Character, String> rules = new HashMap<Character, String>(); rules.put('F', "F+FF-FF-F-F+F+</character,></character,>…
/** * L-system (Koch Curve) * * @author aa_debdeb * @date 2016/02/14 */ LSystem lsystem; void setup(){ size(500, 500); lsystem = new LSystem(); } void draw(){ println("step: " + frameCount); lsystem.draw(); lsystem.step(); } class LSystem{…
/** * Disrupted Sierpinski Carpet * * @author aa_debdeb * @date 2015/10/09 */ int MAX_DEPTH = 5; int MAX_SIZE = 500; float MAX_XY_NOISE_RATIO = 0.3; float MAX_SIZE_NOISE_RATIO = 0.3; Square root; void setup(){ size(500, 500); smooth(); noS…
/** * Circles in Circles * * @author aa_debdeb * @date 2015/10/07 */ int MAX_DEPTH = 5; float MAX_RADIAN_SPEED = PI / 64; Circle root; void setup(){ size(500, 500); smooth(); frameRate(24); noStroke(); root = new Circle(); } void draw(){ c…
/** * Sierpinski Carpet * * @author aa_debdeb * @date 2015/10/05 */ int MAX_DEPTH = 5; int MAX_SIZE = 500; void setup(){ size(500, 500); smooth(); noStroke(); Square root = new Square(); root.draw(); } class Square{ PVector topLeft; float …