aboutsummaryrefslogtreecommitdiff
path: root/src/ElucideanDynamicGraphBuilder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/ElucideanDynamicGraphBuilder.java')
-rw-r--r--src/ElucideanDynamicGraphBuilder.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/ElucideanDynamicGraphBuilder.java b/src/ElucideanDynamicGraphBuilder.java
new file mode 100644
index 0000000..b3968a5
--- /dev/null
+++ b/src/ElucideanDynamicGraphBuilder.java
@@ -0,0 +1,35 @@
+/* */ import java.util.ArrayList;
+/* */
+/* */ public class ElucideanDynamicGraphBuilder
+/* */ implements DynamicGraphBuilder
+/* */ {
+/* */ public void recreate(Graph2D graph)
+/* */ {
+/* 11 */ Point2D minX = (Point2D)graph.getPoints()[0].get(0);
+/* 12 */ Point2D maxX = (Point2D)graph.getPoints()[0].get(graph.getPoints()[0].size() - 1);
+/* 13 */ Point2D minStart = graph.translate(minX);
+/* 14 */ Point2D maxStart = graph.translate(maxX);
+/* */
+/* 16 */ if (minX.getX() > graph.getWindowRange().getXMin()) {
+/* 17 */ for (int i = minStart.getX() - graph.getXSkip(); i >= -graph.getXSkip(); i -= graph.getXSkip()) {
+/* 18 */ for (int j = 0; j < graph.getEquations().length; j++) {
+/* 19 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j]));
+/* 20 */ graph.pushPoint(toAdd, j);
+/* 21 */ graph.trimUp(j);
+/* */ }
+/* */ }
+/* */ }
+/* 25 */ if (maxX.getX() < graph.getWindowRange().getXMax())
+/* 26 */ for (int i = maxStart.getX() + graph.getXSkip(); i <= graph.getWidth() + graph.getXSkip(); i += graph.getXSkip())
+/* 27 */ for (int j = 0; j < graph.getEquations().length; j++) {
+/* 28 */ Point2D toAdd = new Point2D(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.equation(i * graph.getXRes() + graph.getWindowRange().getXMin(), graph.getEquations()[j]));
+/* 29 */ graph.addPoint(toAdd, j);
+/* 30 */ graph.trimDown(j);
+/* */ }
+/* */ }
+/* */ }
+
+/* Location: Modulus.jar
+ * Qualified Name: ElucideanDynamicGraphBuilder
+ * JD-Core Version: 0.6.2
+ */ \ No newline at end of file