From 649d1c1eeca1fb753ca59c28901319f541ec5cc4 Mon Sep 17 00:00:00 2001 From: fdai6887 Date: Mon, 6 Feb 2023 22:15:34 +0100 Subject: [PATCH] add Vmiddle2 --- src/funktion.c | 6 ++++++ src/funktion.h | 1 + src/main.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/funktion.c b/src/funktion.c index 9bd186f..e229fec 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -206,3 +206,9 @@ float Vmiddle(float x1, float z1) { result = result * 0.5; return result; } +float Vmiddle2(float x2,float z2) { + x2 = x2 + z2; + printf("%f", x2 * 0.5); + x2 = x2 * 0.5; + return x2; +} diff --git a/src/funktion.h b/src/funktion.h index 82c1161..f8c840b 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -36,5 +36,6 @@ float Vmultiplier2(float x2,float m); float Vmultiplier3(float x3,float m); double Vparallel(double x1, double x2, double x3, double z1, double z2, double z3); float Vmiddle(float x1, float z1); +float Vmiddle2(float x2, float z2); #endif diff --git a/src/main.c b/src/main.c index 0880ba8..a5a2060 100644 --- a/src/main.c +++ b/src/main.c @@ -156,5 +156,11 @@ int main() x1 = getValue('X'); z1 = getValue('Z'); Vmiddle(x1, z1); + + printf("y eingeben "); + x2 = getValue('X'); + printf("b eingeben "); + z2 = getValue('Z'); + Vmiddle2(x2, z2); }