diff options
author | siddhu8990 | 2017-04-19 14:57:49 +0530 |
---|---|---|
committer | siddhu8990 | 2017-04-19 14:57:49 +0530 |
commit | b9cfdca438347fe4d28f7caff3cb7b382e455d3a (patch) | |
tree | 948593b7d89741f804919a74f2e5e34b39adb0a0 /2.3-1/src/c/elementaryFunctions/Trigonometry/cosd | |
parent | 586db6343e7b472d8dc3e63a82f4c73f99cdcbd7 (diff) | |
download | Scilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.tar.gz Scilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.tar.bz2 Scilab2C-b9cfdca438347fe4d28f7caff3cb7b382e455d3a.zip |
Merged Shamik's work
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/Trigonometry/cosd')
4 files changed, 45 insertions, 0 deletions
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 <math.h> + +void dcosda(double* in,int size,double* out) +{ + double val=0.0; + val =3.14159265/180.0; + int i=0; + for (i=0;i<size;i++) + { + out[i] = cos(in[i]*val); + } +} + diff --git a/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c new file mode 100644 index 00000000..45507577 --- /dev/null +++ b/2.3-1/src/c/elementaryFunctions/Trigonometry/cosd/dcosds.c @@ -0,0 +1,11 @@ +#include <math.h> +#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 <math.h> +#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)); +} |