diff --git a/src/main/c/main_taschenrechner.c b/src/main/c/main_taschenrechner.c index f407180..d99a933 100644 --- a/src/main/c/main_taschenrechner.c +++ b/src/main/c/main_taschenrechner.c @@ -29,6 +29,12 @@ double sineFunction(double angle) { } +double cosineFunction(double angle) { + // Convert degrees to radians for trigonometric functions + return cos(angle * M_PI / 180.0); +} + + // scientificmode int scientificMode(){ diff --git a/src/main/c/taschenrechner.h b/src/main/c/taschenrechner.h index 1ca10c6..a5b9d40 100644 --- a/src/main/c/taschenrechner.h +++ b/src/main/c/taschenrechner.h @@ -11,6 +11,8 @@ int divide(int a, int b); double sineFunction(double angle); +double cosineFunction(double angle); + int mode(int userChoice); int displayMenu();