diff --git a/src/gm/LR_1_v3.java b/src/gm/LR_1_v3.java new file mode 100644 index 0000000..8782870 --- /dev/null +++ b/src/gm/LR_1_v3.java @@ -0,0 +1,36 @@ +package gm; + +import com.annimon.graphics.Application; +import com.annimon.graphics.GraphicsExt; + +public class LR_1_v3 extends Application { + + public static void main(String[] args) { + new LR_1_v3(); + } + + private static final int N = 10; + + public LR_1_v3() { + super(640, 480); + } + + @Override + protected void paint(GraphicsExt g) { + double b = 2.4; + double a = 0.3; + + double x0 = 4.5; + double y0 = 3.5; + for (int j = 0; j < N; j++) { + double x1, y1; + g.move(x0 + b, y0); + for (double phi = 0; phi < 2 * Math.PI; phi += 0.2) { + x1 = x0 + (b - a) * Math.cos(phi) + a * Math.cos((b - a) * phi / a); + y1 = y0 + (b - a) * Math.sin(phi) - a * Math.sin((b - a) * phi / a); + g.draw(x1 + j / GraphicsExt.X_MAX, y1); + } + } + } + +}