Browse Source

add Force

main
fdai7615 2 years ago
parent
commit
3da73be20d
  1. 7
      src/funktion.c
  2. 1
      src/funktion.h
  3. 6
      src/main.c

7
src/funktion.c

@ -380,3 +380,10 @@ double position(double x0, double v0, double a, double t)
{
return x0 + v0 * t + 0.5 * a * t * t;
}
double force(double m, double a)
{
double result;
result = m * a;
printf("%f", result);
return result;
}

1
src/funktion.h

@ -68,5 +68,6 @@ double substraction_2Zahlen(double sZahl1,double sZahl2);
double substraction_3Zahlen(double sZahl1,double sZahl2,double sZahl3);
double velocity(double v0, double a, double t);
double position(double x0, double v0, double a, double t);
double force(double m, double a);
#endif

6
src/main.c

@ -310,4 +310,10 @@ int main()
a=getValue('A');
t=getValue('T');
position(x0, v0, a, t);
printf("Gib die Masse m ein: ");
m=getValue('M');
printf("Gib die Beschleunigung a ein: ");
a=getValue('A');
force(m, a);
}
Loading…
Cancel
Save