Moved some files around
This commit is contained in:
parent
dfad27a51c
commit
2bb7d12a0f
|
@ -1,7 +1,10 @@
|
|||
import PythagorasTree.PythagorasTree;
|
||||
import ch.aplu.turtle.Options;
|
||||
import ch.aplu.turtle.Playground;
|
||||
import ch.aplu.turtle.Turtle;
|
||||
|
||||
import PythagorasTree.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Scanner;
|
||||
|
||||
|
@ -228,11 +231,11 @@ public class Main {
|
|||
System.out.println("PisanoPythagorasTreeOne:");
|
||||
System.out.println("");
|
||||
System.out.println("This creates an asymetric Pythagoras Tree.");
|
||||
System.out.println("The angles used in this tree are generated from the Fibonacci Numbers.");
|
||||
System.out.println("The angles used in this tree are generated from the NumberCalculation.Fibonacci Numbers.");
|
||||
System.out.println("This (and the following variants) are similar to the regular random trees, ");
|
||||
System.out.println("just with angles generated from the Fibonacci Numbers.");
|
||||
System.out.println("just with angles generated from the NumberCalculation.Fibonacci Numbers.");
|
||||
System.out.println("The angles of this variant calculated like this: ");
|
||||
System.out.println("Fibonacci number of the Level modulo 4 multiplied by 10 plus 30");
|
||||
System.out.println("NumberCalculation.Fibonacci number of the Level modulo 4 multiplied by 10 plus 30");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
|
@ -240,7 +243,7 @@ public class Main {
|
|||
System.out.println("PisanoPythagorasTreeTwo:");
|
||||
System.out.println("");
|
||||
System.out.println("The angles of this variant calculated like this: ");
|
||||
System.out.println("Fibonacci number of the Level modulo 2 multiplied by 30 plus 30");
|
||||
System.out.println("NumberCalculation.Fibonacci number of the Level modulo 2 multiplied by 30 plus 30");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
|
@ -248,7 +251,7 @@ public class Main {
|
|||
System.out.println("PisanoPythagorasTreeThree:");
|
||||
System.out.println("");
|
||||
System.out.println("The angles of this variant calculated like this: ");
|
||||
System.out.println("Fibonacci number of the Level modulo 7 multiplied by 5 plus 30");
|
||||
System.out.println("NumberCalculation.Fibonacci number of the Level modulo 7 multiplied by 5 plus 30");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
|
@ -256,7 +259,7 @@ public class Main {
|
|||
System.out.println("PisanoPythagorasTreeFour:");
|
||||
System.out.println("");
|
||||
System.out.println("The angles of this variant calculated like this: ");
|
||||
System.out.println("Fibonacci number of the Level modulo 31 plus 30");
|
||||
System.out.println("NumberCalculation.Fibonacci number of the Level modulo 31 plus 30");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
|
@ -264,7 +267,7 @@ public class Main {
|
|||
System.out.println("PisanoPythagorasTreeFive:");
|
||||
System.out.println("");
|
||||
System.out.println("The angles of this variant calculated like this: ");
|
||||
System.out.println("Fibonacci number of the Level modulo 9 multiplied by 4 plus 29");
|
||||
System.out.println("NumberCalculation.Fibonacci number of the Level modulo 9 multiplied by 4 plus 29");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
package NumberCalculation;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
|
@ -1,7 +1,11 @@
|
|||
package PythagorasTree;
|
||||
|
||||
import ch.aplu.turtle.Turtle;
|
||||
|
||||
import TurtleTools.TurtleState;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.LinkedList;
|
||||
import static TurtleTools.DrawingTools.drawSquare;
|
||||
|
||||
/**
|
||||
* Created by Christian on 10.02.2015.
|
||||
|
@ -37,7 +41,7 @@ public class PythagorasTree {
|
|||
|
||||
tree.turtle.setPenColor(drawColor(tree.momentaryDepth, tree.maximalDepth));
|
||||
tree.turtleState.returnToState(tree.turtle);
|
||||
DrawingTools.drawSquare(tree.turtle, tree.size);
|
||||
drawSquare(tree.turtle, tree.size);
|
||||
|
||||
if (tree.momentaryDepth >= tree.maximalDepth) return true;
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
package PythagorasTree;
|
||||
|
||||
import ch.aplu.turtle.Turtle;
|
||||
|
||||
import java.util.LinkedList;
|
|
@ -1,3 +1,5 @@
|
|||
package PythagorasTree;
|
||||
|
||||
/**
|
||||
* Created by Christian on 11.02.2015.
|
||||
*/
|
|
@ -1,5 +1,9 @@
|
|||
package PythagorasTree;
|
||||
|
||||
import NumberCalculation.Fibonacci;
|
||||
|
||||
/**
|
||||
* Class PythagorasTriangle
|
||||
* Class PythagorasTree.PythagorasTriangle
|
||||
* @author Jan Christian Grünhage
|
||||
*/
|
||||
public class PythagorasTriangle {
|
||||
|
@ -66,7 +70,7 @@ public class PythagorasTriangle {
|
|||
}
|
||||
|
||||
private double kilianEhrmannAngle(int index) {
|
||||
if (index == 0) return 30;
|
||||
if (index == 0 || index == 1) index = 2;
|
||||
double result_1;
|
||||
double result_2;
|
||||
result_1 = 100000000*Math.pow(index,(1/13));
|
||||
|
@ -75,10 +79,7 @@ public class PythagorasTriangle {
|
|||
result_2 = index - Math.pow(result_2, 3);
|
||||
result_2 *= index + (1 / ( Math.pow(index, (1/17.3))));
|
||||
result_2 = Math.pow(result_2, (1/index));
|
||||
if (result_2 != 0) {
|
||||
result_1 /= result_2;
|
||||
result_1 = result_1 % index;
|
||||
}
|
||||
result_1 = result_1 % 30;
|
||||
result_1 += 30;
|
||||
System.out.println("Calculationdepth: " + index);
|
|
@ -1,3 +1,5 @@
|
|||
package PythagorasTree;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
|
@ -1,3 +1,5 @@
|
|||
package TurtleTools;
|
||||
|
||||
import ch.aplu.turtle.Turtle;
|
||||
|
||||
/**
|
||||
|
@ -11,4 +13,14 @@ public class DrawingTools {
|
|||
turtle.forward(size).left(90);
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawFilledSquare(Turtle turtle, double size) {
|
||||
turtle.startPath();
|
||||
int width = (int) size / 10;
|
||||
turtle.penWidth(width);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
turtle.forward(size).left(90);
|
||||
}
|
||||
turtle.fillPath();
|
||||
}
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
package TurtleTools;
|
||||
|
||||
import ch.aplu.turtle.Turtle;
|
||||
|
||||
/**
|
Loading…
Reference in a new issue