Browse Source

Added cosine function for trigonometric calculations

remotes/origin/feature
fdai7782 11 months ago
parent
commit
5e548b90e5
  1. 6
      src/main/c/main_taschenrechner.c
  2. 2
      src/main/c/taschenrechner.h

6
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 // scientificmode
int scientificMode(){ int scientificMode(){

2
src/main/c/taschenrechner.h

@ -11,6 +11,8 @@ int divide(int a, int b);
double sineFunction(double angle); double sineFunction(double angle);
double cosineFunction(double angle);
int mode(int userChoice); int mode(int userChoice);
int displayMenu(); int displayMenu();

Loading…
Cancel
Save