From 814de7a7aeb1ba7a7b131717cb25d578d7bdb508 Mon Sep 17 00:00:00 2001 From: hama Date: Mon, 22 Sep 2014 08:52:32 +0200 Subject: [PATCH] Synchronisierung mit dem externen Repository --- src/de/hamatoma/jkurs/Lesson1.java | 39 ++++++++++++++++++++++++ src/de/hamatoma/jkurs/Lesson1b.java | 46 +++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 src/de/hamatoma/jkurs/Lesson1.java create mode 100644 src/de/hamatoma/jkurs/Lesson1b.java diff --git a/src/de/hamatoma/jkurs/Lesson1.java b/src/de/hamatoma/jkurs/Lesson1.java new file mode 100644 index 0000000..c3da7c5 --- /dev/null +++ b/src/de/hamatoma/jkurs/Lesson1.java @@ -0,0 +1,39 @@ +/** + * + */ +package de.hamatoma.jkurs; + +import java.lang.Math; + +public class Lesson1 { + public static void main(String[] args) { + double a = 1; + double s = 2; + double w0 = Math.atan(a / s); + double lastW = w0; + int n = 1; + double wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("1: Winkel: %f Diff: %f", wN, wN + - lastW)); + lastW = wN; + n = 2; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 3; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 4; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 5; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + } +} diff --git a/src/de/hamatoma/jkurs/Lesson1b.java b/src/de/hamatoma/jkurs/Lesson1b.java new file mode 100644 index 0000000..f4024f1 --- /dev/null +++ b/src/de/hamatoma/jkurs/Lesson1b.java @@ -0,0 +1,46 @@ +/** + * + */ +package de.hamatoma.jkurs; + +/** + * @author hm + * + */ +public class Lesson1b { + + /** + * @param args + */ + public static void main(String[] args) { + double a = 1; + double s = 2; + double w0 = Math.atan(a / s); + double lastW = w0; + int n = 1; + double wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("1: Winkel: %f Diff: %f", wN, wN + - lastW)); + lastW = wN; + n = 2; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 3; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 4; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + lastW = wN; + n = 5; + wN = Math.atan(a / (s - n / 100.0)); + System.out.println(String.format("%d: Winkel: %f Diff: %f", n, wN, wN + - lastW)); + } + +} -- 2.39.5