X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2FGraphDemo.java;h=3dd930309d527c1b3ba70951cf6e937b5aceefba;hb=refs%2Fheads%2Fmaster;hp=3639c10dd892e331c877d6195f755f7ed67dae4b;hpb=708969a9a1413480d4679bec1642ef550fc6dc84;p=sixth-3d-demos.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java index 3639c10..3dd9303 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/GraphDemo.java @@ -16,7 +16,6 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon.SolidPo import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.Graph; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.WireframeSphere; -import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -25,6 +24,7 @@ public class GraphDemo { private static final double WAVE_FREQUENCY = 50d; private static final double WAVE_AMPLITUDE = 50d; private static final Color SQUARE_PLATE_COLOR = new Color("88F7"); + private static final double GRAPH_SCALE = 50d; private static void makeSquarePlate(final ShapeCollection shapeCollection, final double y, final double x, final double z) { @@ -56,8 +56,6 @@ public class GraphDemo { } } - private static final double scale = 50d; - private static Graph getCosineGraph(final Point3D location) { final List data = new ArrayList<>(); for (double x = 0; x < 20; x += 0.25) { @@ -67,7 +65,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "Cosine", location); + return new Graph(GRAPH_SCALE, data, "Cosine", location); } private static Graph getFormula1Graph(final Point3D location) { @@ -79,7 +77,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "y = sin(tan(x))", location); + return new Graph(GRAPH_SCALE, data, "y = sin(tan(x))", location); } private static Graph getFormula2Graph(final Point3D location) { @@ -91,7 +89,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "y = ( (10-x)^2 ) / 30", location); + return new Graph(GRAPH_SCALE, data, "y = ( (10-x)^2 ) / 30", location); } private static Graph getFormula3Graph(final Point3D location) { @@ -103,7 +101,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "y = sin(x/2) + sin(x/1.26)", location); + return new Graph(GRAPH_SCALE, data, "y = sin(x/2) + sin(x/1.26)", location); } private static Graph getSineGraph(final Point3D location) { @@ -115,7 +113,7 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "Sine", location); + return new Graph(GRAPH_SCALE, data, "Sine", location); } private static Graph getTangentGraph(final Point3D location) { @@ -132,10 +130,10 @@ public class GraphDemo { data.add(p); } - return new Graph(scale, data, "Tangent", location); + return new Graph(GRAPH_SCALE, data, "Tangent", location); } - public static void main(final String[] args) throws IOException { + public static void main(final String[] args) { final ViewFrame viewFrame = new ViewFrame(); final ShapeCollection geometryCollection = viewFrame.getViewPanel()