From 861e1295846f94ebc04d834739ae36f72d3e36a0 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 24 Feb 2014 10:00:10 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=9B=D0=A0-1=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0?= =?UTF-8?q?=D0=BD=D1=82=208?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gm/LR_1_v8.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gm/LR_1_v8.java b/src/gm/LR_1_v8.java index c20b8f2..be50c38 100644 --- a/src/gm/LR_1_v8.java +++ b/src/gm/LR_1_v8.java @@ -17,11 +17,11 @@ public class LR_1_v8 extends Application { private static final double ARROW_HEIGHT = 0.2; private static final double[][] ARROW_PTS = { // x, y + {ARROW_WIDTH, 0.0}, + {0.0, 0.0}, + {2d * ARROW_WIDTH / 5d, ARROW_HEIGHT}, + {2d * ARROW_WIDTH / 5d, -ARROW_HEIGHT}, {0.0, 0.0}, - {ARROW_WIDTH, 0.0}, - {4d * ARROW_WIDTH / 5d, ARROW_HEIGHT}, - {4d * ARROW_WIDTH / 5d, -ARROW_HEIGHT}, - {ARROW_WIDTH, 0.0}, }; private static final double N = 30; @@ -33,6 +33,7 @@ public class LR_1_v8 extends Application { @Override protected void paint(GraphicsExt g) { + drawArrow(g, 1d); double x1 = 0, y1 = 2.5; for (int i = 0; i < N; i++) { final double scaleValue = (i / 24d); @@ -40,7 +41,7 @@ public class LR_1_v8 extends Application { double y2 = y1 + Math.sin(x2) / 5d; g.reset(); g.translate(x2, y2); - g.rotate(-Math.atan2(y2 - y1, x2 - x1)); + g.rotate(Math.atan2(y2 - y1, x1 - x2)); drawArrow(g, scaleValue); x1 = x1 + ARROW_WIDTH * scaleValue; y1 = y2;