Дополнена ЛР-1 вариант 8
This commit is contained in:
parent
fac98d3a1b
commit
861e129584
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user