From 6883c4f59ae8e7cc2ec05950d9f18fe8738147a8 Mon Sep 17 00:00:00 2001 From: fdai7460 Date: Mon, 30 Jan 2023 11:36:46 +0100 Subject: [PATCH] Leibniz Formel --- src/main/java/src/TasksFrame.java | 20 ++++++++++++++++++++ src/test/java/src/TasksFrameTest.java | 15 +++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/test/java/src/TasksFrameTest.java diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index 89ef967..b1b5809 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -68,8 +68,28 @@ public class TasksFrame extends JFrame { setup5ModList(1, 20); + setupLeibnizR(1000); + + } + + public double setupLeibnizR(int t) { + double sum=0; + for(int i=0;i setup5ModList(int from, int to) { ArrayList mods = new ArrayList<>(); diff --git a/src/test/java/src/TasksFrameTest.java b/src/test/java/src/TasksFrameTest.java new file mode 100644 index 0000000..feea7dd --- /dev/null +++ b/src/test/java/src/TasksFrameTest.java @@ -0,0 +1,15 @@ +package src; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +class TasksFrameTest { + + @Test + void setupLeibnizR() { + TasksFrame tasksFrame = new TasksFrame(); + double x = tasksFrame.setupLeibnizR(100000); + assertEquals(Math.PI/4, x, 0.00001, "Die Werte sind unterschiedlich. Soll: 0.785 Ist:" +x); + } +} \ No newline at end of file