diff --git a/src/funktion.c b/src/funktion.c index 619a092..df0f35d 100644 --- a/src/funktion.c +++ b/src/funktion.c @@ -387,4 +387,11 @@ double force(double m, double a) double work(double a, double d,double m) { return (m * a) * d; +} +double power(double a, double m, double d, double t) +{ + double result; + result = ((m * a) * d) / t; + printf("%f", result); + return result; } \ No newline at end of file diff --git a/src/funktion.h b/src/funktion.h index 18b1fd1..2f73ce7 100644 --- a/src/funktion.h +++ b/src/funktion.h @@ -70,5 +70,6 @@ double velocity(double v0, double a, double t); double position(double x0, double v0, double a, double t); double force(double m, double a); double work(double a, double d,double m) ; +double power(double a, double m, double d, double t); #endif diff --git a/src/main.c b/src/main.c index 0098eee..8aa43be 100644 --- a/src/main.c +++ b/src/main.c @@ -319,4 +319,14 @@ int main() m=getValue('M'); d=getValue('D'); work(a, d, m); + + printf("Gib die Beschleunigung a ein: "); + a=getValue('A'); + printf("Gib die Masse m ein: "); + m=getValue('M'); + printf("Gib die Strecke d ein: "); + d=getValue('D'); + printf("Gib die Zeit t ein: "); + t=getValue('T'); + power(a,m,d,t); }