From 2b1a599aee923f09ea1cfcd48c0b4b5e17f1fe21 Mon Sep 17 00:00:00 2001 From: Leon Wolf Date: Thu, 8 Feb 2024 17:53:58 +0100 Subject: [PATCH] Commit trigonometric Functions --- src/trigonometricFunctions.c | 25 +++++++++++++++++++++++++ src/trigonometricFunctions.h | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/trigonometricFunctions.c create mode 100644 src/trigonometricFunctions.h 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