From 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 Mon Sep 17 00:00:00 2001 From: Joshua Rahm Date: Fri, 30 Jan 2015 17:11:48 -0700 Subject: added source --- src/ElucideanDynamicGraphBuilder.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/ElucideanDynamicGraphBuilder.java (limited to 'src/ElucideanDynamicGraphBuilder.java') 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 -- cgit