Browse Source

add vPunkt

main
fdai6887 2 years ago
parent
commit
7532850044
  1. 14
      src/funktion.c
  2. 1
      src/funktion.h
  3. 27
      src/main.c

14
src/funktion.c

@ -235,3 +235,17 @@ double Vangle(float x1, float x2, float x3, float z1, float z2, float z3) {
double result = acos(s) * 180 / M_PI;
return 11;
}
float vPunkt(float x1, float x2, float x3, float z1, float z2, float z3, float p1, float p2, float p3) {
float e1 = (p1 - x1) / z1;
float e2 = (p2 - x2) / z2;
float e3 = (p3 - x3) / z3;
if (e1 == e2 && e2 == e3) {
printf("Punkt liegt auf Vektor\n\n");
return 1;
} else {
printf("Punkt liegt nicht auf Vektor\n\n");
return 0;
}
return 0;
}

1
src/funktion.h

@ -40,5 +40,6 @@ float Vmiddle2(float x2, float z2);
float Vmiddle3(float x3, float z3);
float Vskalort(float x1, float x2, float x3, float z1, float z2, float z3);
double Vangle(float x1, float x2, float x3, float z1, float z2, float z3);
float vPunkt(float x1, float x2, float x3, float z1, float z2, float z3, float p1, float p2, float p3);
#endif

27
src/main.c

@ -182,4 +182,31 @@ int main()
z2 = getValue('Z');
z3 = getValue('Z');
Vangle(x1,x2,x3,z1,z2,z3);
printf("Stuetzvektor\n");
printf("1. Vektor\n");
printf("x eingeben");
x1 = getValue('X');
printf("y eingeben ");
x2 = getValue('X');
printf("z eingeben");
x3 = getValue('X');
printf("2. Vektor\n");
printf("a eingeben");
z1 = getValue('Z');
printf("b eingeben ");
z2 = getValue('Z');
printf("c eingeben");
z3 = getValue('Z');
printf("Punkt\n");
printf("2. Vektor\n");
printf("P1 eingeben");
p1 = getValue('P');
printf("P2 eingeben ");
p2 = getValue('P');
printf("P3 eingeben");
p3 = getValue('P');
vPunkt(x1,x2,x3,z1,z2,z3,p1,p2,p3);
}
Loading…
Cancel
Save