Browse Source

add Vlength

main
fdai6887 2 years ago
parent
commit
c9b39ed3fd
  1. 9
      src/funktion.c
  2. 1
      src/funktion.h
  3. 11
      src/main.c

9
src/funktion.c

@ -123,3 +123,12 @@ float Vshift(float x1, float s1) {
float result = x1 + s1;
return result;
}
double Vlength(float x1, float x2, float x3) {
double X1, X2, X3, E;
X1 = x1 * x1;
X2 = x2 * x2;
X3 = x3 * x3;
E = X1 + X2 + X3;
printf("Die laenge das Vektors betraegt: %f\n\n", sqrt(E));
return sqrt(E);
}

1
src/funktion.h

@ -24,5 +24,6 @@ double erloesfunktion(double p,double q);
double grenzGewinn(double p,double q,double tc);
double GewinnMaximum(double p,double q,double tc,double tr);
float Vshift(float x1,float s1);
double Vlength(float x1, float x2, float x3);
#endif

11
src/main.c

@ -6,7 +6,7 @@
int main()
{
double a,b,c,d,h,x1,s1;
double a,b,c,d,h,x1,s1,x2,x3;
a = getValue('a');
b = getValue('b');
h = getValue('h');
@ -103,4 +103,13 @@ int main()
x1 = getValue('X');
s1 = getValue('s');
Vshift(x1,s1);
printf("Vektor\n");
printf("x eingeben");
x1 = getValue('X');
printf("y eingeben ");
x2 = getValue('X');
printf("z eingeben");
x3 = getValue('X');
Vlength(x1, x2, x3);
}
Loading…
Cancel
Save