From b9cfdca438347fe4d28f7caff3cb7b382e455d3a Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 19 Apr 2017 14:57:49 +0530 Subject: Merged Shamik's work --- 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c | 14 ++++++++++++++ 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c | 11 +++++++++++ 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c | 9 +++++++++ 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c | 11 +++++++++++ 4 files changed, 45 insertions(+) create mode 100644 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c create mode 100644 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c create mode 100644 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c create mode 100644 2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c (limited to '2.3-1/src/c/elementaryFunctions/Trigonometry/cosd') diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c new file mode 100644 index 00000000..b48876e3 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosda.c @@ -0,0 +1,14 @@ +#include "cosd.h" +#include + +void dcosda(double* in,int size,double* out) +{ + double val=0.0; + val =3.14159265/180.0; + int i=0; + for (i=0;i +#include "cos.h" +#include "cosd.h" + +double dcosds(double in) +{ + if(cos((M_PI/180.0)*in)==0.0) + return 0.0; + else + return (cos((M_PI/180.0)*in)); +} diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c new file mode 100644 index 00000000..5224899b --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosda.c @@ -0,0 +1,9 @@ +#include "cos.h" +#include "cosd.h" + +void scosda(float* in, int size, float* out) { + int i = 0; + for (i = 0; i < size; ++i) { + out[i] = scosds(in[i]); + } +} diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c new file mode 100644 index 00000000..e99a1952 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/scosds.c @@ -0,0 +1,11 @@ +#include +#include "cosd.h" +#include "cos.h" + +float scosds(float in) +{ + if(cosf((M_PI/180.0)*in)==0.0) + return 0.0; + else + return (cosf((M_PI/180.0)*in)); +} -- cgit