From 9c14fed134161a284c88b2db5d2675f97f10b2bd Mon Sep 17 00:00:00 2001 From: fdai6887 Date: Mon, 6 Feb 2023 21:57:46 +0100 Subject: [PATCH] add Vmiddle --- src/funktion.c | 6 ++++++ src/funktion.h | 1 + src/main.c | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/src/funktion.c b/src/funktion.c index d4280cf..08ab236 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -201,3 +201,9 @@ double Vparallel(double x1, double x2, double x3, double z1, double z2, double z } return result; } +float Vmiddle(float x1, float z1) { + x1 = x1 + z1; + printf("(%f|", x1 * 0.5); + x1 = x1 * 0.5; + return x1; +} diff --git a/src/funktion.h b/src/funktion.h index 0a6e9f4..82c1161 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -35,5 +35,6 @@ float Vmultiplier(float x1,float m); 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); #endif diff --git a/src/main.c b/src/main.c index 0383151..9c36a04 100644 --- a/src/main.c +++ b/src/main.c @@ -152,5 +152,13 @@ int main() z2 = getValue('Z'); z3 = getValue('Z'); Vparallel(x1, x2, x3, z1, z2, z3); + + printf("1. Vektor\n"); + printf("x eingeben"); + x1 = getValue('X'); + printf("2. Vektor\n"); + printf("a eingeben"); + z1 = getValue('Z'); + Vmiddle(x1, z1); }