diff --git a/src/trigonometricFunctions.c b/src/trigonometricFunctions.c new file mode 100644 index 0000000..0a9a956 --- /dev/null +++ b/src/trigonometricFunctions.c @@ -0,0 +1,25 @@ + +#include "trigonometricFunctions.h" +#include "math.h" +#include +#include + +double* calculate_sin_double(double angle) { + double* result= malloc(sizeof (double)); + *result=sin(angle); + return result; +} + + +double* calculate_cos_double(double angle) { + double* result= malloc(sizeof (double)); + *result=cos(angle); + return result; +} + + +double* calculate_tan_double(double angle) { + double* result= malloc(sizeof (double)); + *result=tan(angle); + return result; +} diff --git a/src/trigonometricFunctions.h b/src/trigonometricFunctions.h new file mode 100644 index 0000000..add1a8a --- /dev/null +++ b/src/trigonometricFunctions.h @@ -0,0 +1,9 @@ + +#ifndef THEADMIRALS_TRIGONOMETRICFUNCTIONS_H +#define THEADMIRALS_TRIGONOMETRICFUNCTIONS_H + +double* calculate_sin_double(double angle); +double* calculate_cos_double(double angle); +double* calculate_tan_double(double angle); + +#endif //THEADMIRALS_TRIGONOMETRICFUNCTIONS_H